kwhat / jnativehook

Global keyboard and mouse listeners for Java.
Other
1.73k stars 344 forks source link

nativeKeyTyped is never fired. Key character is always the same. #226

Open zeroeightysix opened 6 years ago

zeroeightysix commented 6 years ago

I'm experiencing two issues.

  1. nativeKeyTyped is never fired. Pressing a key will fire nativeKeyPressed, but holding that key down until the characters start repeating will, instead of firing nativeKeyTyped, keep firing nativeKeyPressed.
  2. getKeyChar, is for every key and every event always ￿ - that's (char) 65535;.

Here's the code I used to test.

When holding the a key and letting it repeat itself: output Pressing random keys. Notice the character is the same: output

Tested on: 64-Bit Windows 10 Pro AZERTY Keyboard (Belgian layout) (Corsair Strafe RGB)

kwhat commented 6 years ago

Something is not being processed correctly with your layout. Check the log output at the debug level for key events and see if there is an error loading any language DLL files or something like that.

zeroeightysix commented 6 years ago

I set the logger to ALL, moved my mouse, mashed a few keys and then terminated the application. Here's the output: outlog.log (Also contains the debug output I made myself, same code as originally posted) I couldn't spot any errors, though.

kwhat commented 6 years ago

The issue is at SEVERE: refresh_locale_list [628]: Could not find keyboard map for locale 0X0000000008130813! You are not getting key typed events because the layout could not load thus the key typed event didn't produce a key char. I think this is fixed in the trunk. I am working on getting the compiler working again. Nightly soon.

Karpatenhund commented 6 years ago

Hi there! Any update/est. on this matter?

kwhat commented 6 years ago

Hey, I just got the OS X compiler compiling again. There were some issues with LLVM 6 and there were a lot of crufty patches and questionable headers being used in the old process. Anyway, I should have a better working toolchain in the next week maybe two and then I can start doing nightly builds again.

On Mon, Jul 2, 2018 at 2:12 AM, Nils notifications@github.com wrote:

Hi there! Any update/est. on this matter?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/kwhat/jnativehook/issues/226#issuecomment-401726375, or mute the thread https://github.com/notifications/unsubscribe-auth/AApRRHf5kXRUxbdVpf7kp_Pq0D0R95oWks5uCeQUgaJpZM4UhS-2 .

Karpatenhund commented 6 years ago

Awesome! Thanks for all the work you put into this project. Really appreciate it! :)

jillianketterer commented 5 years ago

Hello! Any updates or estimates on this fix?

xt449 commented 5 years ago

Same issue with being unable to find keyboard map. Windows 10 Home 64 bit QWERTY Keyboard English US layout (on laptop) JDK 8 and OpenJDK 11

Mar 08, 2019 12:05:35 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: process_key_pressed [227]: Key 0X25 pressed. (0X4B)

Mar 08, 2019 12:05:35 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: refresh_locale_list [470]: GetKeyboardLayoutList(0, NULL) found 1 layouts.

Mar 08, 2019 12:05:35 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: refresh_locale_list [487]: Received 1 locales.

Mar 08, 2019 12:05:35 PM org.jnativehook.GlobalScreen$NativeHookThread enable
SEVERE: refresh_locale_list [628]: Could not find keyboard map for locale 0X0000000004090409!

Mar 08, 2019 12:05:35 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: win_hook_event_proc [634]: Restarting Windows input hook on window event: 0X800C.

Mar 08, 2019 12:05:35 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: process_key_released [286]: Key 0X25 released. (0X4B)