jnativehook icon indicating copy to clipboard operation
jnativehook copied to clipboard

Failed to locate a valid keyboard on Fedora 35

Open SteveOhByte opened this issue 2 years ago • 3 comments

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.

SteveOhByte avatar Apr 11 '22 14:04 SteveOhByte

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);

kwhat avatar Apr 12 '22 13:04 kwhat

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.

SteveOhByte avatar Apr 12 '22 22:04 SteveOhByte

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:

darrencocco avatar Jul 26 '22 09:07 darrencocco