-
Notifications
You must be signed in to change notification settings - Fork 186
WIP: add linux grabbing #47
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
Conversation
|
Hmm grab and listen at the same time should go in a specific order, as as I understand it, the latter gets placed on top of the other. That's why there are sleeps in the grab test.
As I can see the error seems to be that the KeyRelease of Tab gets captured, and I think in the test I only grabbed the keypress. Because you now send a |
|
PS: just checked out your branch to check how it worked, it behaves the same way that my tries did, which is that as long as you are grabbing , no events ever reaches the rest of the OS, which means I have to reboot, I don't have access to a terminal anymore (just reallized I didn't check if TTY still worked). I'm using Ubuntu 18.04 with Awesome window manager, maybe that's the problem ? |
I included an escape hatch (that will be removed before shipping) - just press escape to stop grabbing. Furthermore, on Linux, ctrl-alt-F3 brings you to the linux terminal emulator, regardless of anything the X server is doing. There are actually multiple virtual terminals - usually one is used for login, one for the main graphical environment and the rest (by default 6 total) for plain virtual terminals. So ctrl-alt-{F3-F6} all work. From a virtual terminal I used htop to stop the rdev process multiple times.
It's a bit embarrassing to admit, but I missed this in testing. There are a few methods I'm investigating, including sending events to focused windows instead of the root window, ungrabbing before simulating and looking through all of XCB's documentation for other options... |
test_grab fails because simulate() operates on the level of x11, but grab() operates at a lower level, so never sees simulated events.
|
I created a separate crate - |
|
Seems reasonable. I will probably pull gel-o into rdev so it depends directly on evdev, I feel it's a bit more appropriate to not add layers of dependencies if possible. Event evdev dependency would probably be behind the grab feature flag. I could do that after your PR is ready to merge, |
|
Done in #52 |
I'm not sure how pointer grabbing is supposed to work, but this doesn't seem right - it gets pointer events, but doesn't cancel them. It fails tests because
listenstill gets events, even though windows don't get them...