-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux still prints screen when hitting "print" #29
Comments
I've tested again on windows with Pyhook and the normal behavior still happens... It's just that I couldn't see it. Do you have an idea of how to consume the event so that it's not grabbed by other apps? |
I don't think that's possible with pyxhook right now. You can see #15 it's the same problem. Otherwise you can change the configuration of keyboard shortcuts with python on linux but this depends on the desktop environment and is not recommended. Users are free to change their keyboard shortcuts as they wish, or else you must use a dead key for both systems. |
@calumah Indeed it seems impossible with pyxhook right now. I've been digging a bit more into xlib and there might be something with |
I've finally managed to do what I want! For anyone curious, here's how to completely grab the 'print' key, without event propagation:
This will print the event details. Here is an output example:
|
Hi, I'm trying to use pyxhook to catch users hitting the "print screen" key. I successfully catch the event, but linux still run the default behavior, which is making a screenshot. With pyhook on Windows, the behavior is different, as the default "print screen" action is not happening.
One solution could be to remove the mapping between "print screen" and screenshot under linux, but I'd like to avoid that, making life easier to support different distros and OS.
Is there a way to "consume" the event after it was caught by my script ?
The text was updated successfully, but these errors were encountered: