jnativehook
jnativehook copied to clipboard
Wayland support
Hi @kwhat,
Now that Wayland is the default display server in Ubuntu, are there any plans to add support for Wayland in JNativeHook?
Yes, I need to make xkbcommon a runtime dependency but it should be fairly easy. Which version of ubuntu contains wayland by default?
Wayland is the default display server in Ubuntu 17.10. As far as I could tell, it is not clear currently if it will still be the default option in Ubuntu 18.04 LTS.
+1 for that. I'd like to consume (stop propagation) of events on Linux, and that seems to be impossible on X11, right? Maybe we could have that with Wayland.
Sample implementation: https://github.com/Aishou/wayland-keylogger/blob/master/Keylogger.cpp
Maybe this project could also be a good inspiration:
https://github.com/snyball/Hawck
It works by putting a deamon between physical keyboard and virtual keyboard.
That method would defiantly allow to consume key events and would be independent of Window Manager / Desktop Environment.
I don't know if this technique could be adapted for JNativeHook. But maybe it could be usefull.
+1 also standard on Fedora 35/36 IIRC correctly. (I'm using Wayland myself on F36 if you need a tester)
Hi! How's the progress on the wayland implementation?
It is in progress here. It is going to take some time and I am not sure this will work but it shows some promise right now. I currently have a bunch of changes locally to cleanup the PoC code that is currently there but it doesn't work yet. Updates are tracked against this issue.
Just and update. Evdev support is mostly working upstream. Consuming keys appears to work correctly, mouse motion and wheel events maybe more of an issue. The last major hurdle will be the system_properties because there doesn't appear to be a generic way of doing a lot of this outside of X11. Getting things like the mouse sensitivity, double click speed and monitor count and resolution are all going to be a pain if not impossible under Wayland.