Skip to content
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

[Draft] Hack fix to wayland key grab #24

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Spaceslug
Copy link

Instead of using rdev's simulate function to pass through mouse button presses when not preforming gestures. I am instead sending the mouse keycode to a modified python script I ripped from the libinput repo. The script uses evdev library to create a virtual mouse and then presses the gesture key. Since the device is created after mouse-actions starts to grap input, mouse-actions is not aware of the event.

This allows me to use mouse-actions on wayland and the gesture button is not stolen.

I don't intend for this pull request to be accepted. I only want to show a workaround in case other people want it.

There exists rust bindings for evdev which could be used for a more clean solution. I might implement that at one point, but I have never coded in rust before.

If you want to try my hack you have to build my pull request, have python-evdev installed, and move the script play-event.py to a folder in your PATH.

@pallaswept
Copy link

This is a good proof of concept for the proposed (rust based) resolution to #8

But the big problem we have on Wayland is that all of the Wayland input handling apps take the same approach of exclusively grabbing the evdev input devices, meaning we can only use ONE input handling app: #17 ... So even if we fix mouse-actions we're still totally screwed if we need to use anything else as well.

@Spaceslug
Copy link
Author

@pallaswept yeah the situation is pretty bad. I think libei is supposed to be a solution to emulated input in wayland. I don't know how ready libei is or if anyting have implemented it.

@pallaswept
Copy link

@pallaswept yeah the situation is pretty bad. I think libei is supposed to be a solution to emulated input in wayland. I don't know how ready libei is or if anyting have implemented it.

Thanks very much for the tip!! I hadn't heard of it at all so I'm going to read into it.

And thanks again for this PR, it's nice to have a working POC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants