jnativehook icon indicating copy to clipboard operation
jnativehook copied to clipboard

Wayland support

Open alexandru-crossover opened this issue 6 years ago • 9 comments

Hi @kwhat,

Now that Wayland is the default display server in Ubuntu, are there any plans to add support for Wayland in JNativeHook?

alexandru-crossover avatar Jan 22 '18 15:01 alexandru-crossover

Yes, I need to make xkbcommon a runtime dependency but it should be fairly easy. Which version of ubuntu contains wayland by default?

kwhat avatar Jan 22 '18 19:01 kwhat

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.

alexandru-crossover avatar Jan 23 '18 07:01 alexandru-crossover

+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.

leandrocm86 avatar Feb 02 '18 17:02 leandrocm86

Sample implementation: https://github.com/Aishou/wayland-keylogger/blob/master/Keylogger.cpp

kwhat avatar Apr 15 '21 15:04 kwhat

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.

J0B10 avatar Apr 16 '21 05:04 J0B10

+1 also standard on Fedora 35/36 IIRC correctly. (I'm using Wayland myself on F36 if you need a tester)

darrencocco avatar Jul 26 '22 09:07 darrencocco

Hi! How's the progress on the wayland implementation?

lov3b avatar Mar 31 '23 20:03 lov3b

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.

kwhat avatar Sep 15 '23 02:09 kwhat

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.

kwhat avatar Jan 10 '24 04:01 kwhat