-
Notifications
You must be signed in to change notification settings - Fork 123
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
How to prevent event propagation? #57
Comments
Hi, It is possible for Windows and OS X systems, however, it is not currently possible on Linux or Unix. To use this functionality, you need to set the reserved flag of the uiohook_event structure to |
Thank you!
But events still emits to the system. What I'm doing wrong? |
That looks correct, which branch are you compiling? The master branch is probably broken and 1.1 is the current stable. |
I use 1.1 branch. Some later I try remove current version of libuiohook and clone clean 1.1. But I think it is not help. |
Yes, if you set the reserved flag, it will prevent the event it was set for from propagating. So if it was a mouse move event, the mouse will not move. If it was a key down and key up, you will not be able to type. |
Please post the code you are using for the callback so I may better help you. |
I am not sure if it matters in your implementation, but the reserved flag must be set on the same thread context that it was called from. So you cannot copy the memory to a different thread. |
Please look at this file https://github.com/WilixLead/iohook/blob/master/src/iohook.cc
As I think, It should prevent all propagation. But really no :( |
Is it still the case that preventing event propagation is not possible on *nix? If so are there any plans to add this functionality? Thanks |
It's not possible on X11 due to some technical limitations and I doubt that will ever change. It maybe possible on Wayland, but that hasn't really seen widespread adoption thus far. Migrating this library to wayland is going to take substantial effort and I haven't really looked into it much at this point. If anyone really wants this functionality, start looking into wayland to see this maybe possible. I only have so many hours in a day and right now 2.2 getting finalized and a 3.0 refactor to fix several other long standing issues are a priority. |
I can't find way to prevent event. Can libuiohook do it?
Will be cool prevent event after receiving (optionally)
The text was updated successfully, but these errors were encountered: