kwhat / jnativehook

Global keyboard and mouse listeners for Java.
Other
1.75k stars 347 forks source link

Failed to locate a valid keyboard on Fedora 35 #406

Open SteveOhByte opened 2 years ago

SteveOhByte commented 2 years ago

I'm trying to use JNativeHook on a laptop running Fedora 35 and I keep getting this error:

Apr 11, 2022 10:37:44 AM com.github.kwhat.jnativehook.GlobalScreen$NativeHookThread enable SEVERE: load_input_helper [1827]: XkbGetKeyboard failed to locate a valid keyboard!

This is the code I used to start the hook (runs in main method): GlobalScreen.setEventDispatcher(new SwingDispatchService()); try { GlobalScreen.registerNativeHook(); } catch (NativeHookException e) { e.printStackTrace(); }

My laptop is a Lenovo ThinkPad X1 Carbon 6th gen if that helps.

kwhat commented 2 years ago

Fedora doesn't seem to play well with Xkb stuff. I am working on a rewrite for X11 machines that should do a much better job with keyboard and language support but that won't be ready until 2.3.

The call that is failing is XkbDescPtr desc = XkbGetKeyboard(helper_disp, XkbGBN_AllComponentsMask, XkbUseCoreKbd);

SteveOhByte commented 2 years ago

Fedora doesn't seem to play well with Xkb stuff. I am working on a rewrite for X11 machines that should do a much better job with keyboard and language support but that won't be ready until 2.3.

The call that is failing is XkbDescPtr desc = XkbGetKeyboard(helper_disp, XkbGBN_AllComponentsMask, XkbUseCoreKbd);

Alright, thanks for the response. I'll try again whenever 2.3 releases.

darrencocco commented 2 years ago

Heyo, this looks to be an issue in Fedora 36 unsurprisingly. Looking forward to this one being fixed because it is my current(and hopefully last) blocker for packaging someone else's work for F36. Thanks for all the effort you put in :smiley: