jnativehook icon indicating copy to clipboard operation
jnativehook copied to clipboard

Could not find keyboard map for locale 0X0000000004090409!

Open rsyanik opened this issue 8 years ago • 12 comments

When using the Example Code for the GlobalKeyboardListener I get the following logging info: I realize there is an open issue about this already, but i wanted to add this in because it doesn't seem to me that this should be happening with the example code.

Key Pressed: J Jul 05, 2017 9:52:39 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: refresh_locale_list [470]: GetKeyboardLayoutList(0, NULL) found 1 layouts.

Jul 05, 2017 9:52:39 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: refresh_locale_list [487]: Received 1 locales.

Jul 05, 2017 9:52:39 AM org.jnativehook.GlobalScreen$NativeHookThread enable SEVERE: refresh_locale_list [628]: Could not find keyboard map for locale 0X0000000004090409!

Jul 05, 2017 9:52:39 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: process_key_released [286]: Key 0X24 released. (0X4A)

Key Released: J Jul 05, 2017 9:52:55 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: process_key_pressed [227]: Key 0X12 pressed. (0X45)

Key Pressed: E Jul 05, 2017 9:52:55 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: refresh_locale_list [470]: GetKeyboardLayoutList(0, NULL) found 1 layouts.

Jul 05, 2017 9:52:55 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: refresh_locale_list [487]: Received 1 locales.

Jul 05, 2017 9:52:55 AM org.jnativehook.GlobalScreen$NativeHookThread enable SEVERE: refresh_locale_list [628]: Could not find keyboard map for locale 0X0000000004090409!

Jul 05, 2017 9:52:55 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: process_key_released [286]: Key 0X12 released. (0X45)

Key Released: E Jul 05, 2017 9:53:00 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: win_hook_event_proc [634]: Restarting Windows input hook on window event: 0X800C.

Jul 05, 2017 9:53:07 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: process_key_pressed [227]: Key 0X12 pressed. (0X45)

Jul 05, 2017 9:53:07 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: refresh_locale_list [470]: GetKeyboardLayoutList(0, NULL) found 1 layouts.

Jul 05, 2017 9:53:07 AM org.jnativehook.GlobalScreen$NativeHookThread enable INFO: refresh_locale_list [487]: Received 1 locales.

Key Pressed: E

rsyanik avatar Jul 05 '17 14:07 rsyanik

This is a duplicate of bug #170, I have a fix but no time because I am too busy fixing gearman bugs right now...

kwhat avatar Jul 05 '17 21:07 kwhat

pls @kwhat, according to the error code: SEVERE: refresh_locale_list [628]: Could not find keyboard map for locale 0X0000000004090409! I think this indicate the nativeKeyTyped event could not response properly, because with me here am having the same issue where I tried to get the character value for the key-typed within the method, and instead to return the char value it rather return the above error. it will be more appreciated if this bug could address at earliest . Thanks!

distechDeveloper avatar Jul 21 '17 03:07 distechDeveloper

Ok this should address a number of issues that people have been having including this one. Please test and let me know if this issue can be closed.

JNativeHook-2.1.1-rc

JNativeHook-2.0.4-rc

kwhat avatar Jul 30 '17 20:07 kwhat

Ops! Am having different issue again! is not showing the correct keyTyped... here is my override method @Override public void nativeKeyTyped(NativeKeyEvent e) { System.out.println("KeyTyped:" + NativeKeyEvent.getKeyText(e.getKeyChar())); }

when i run, here is the result!

KeyPressed: 1 KeyTyped:N Key Released: 1 KeyPressed: 2 KeyTyped:M Key Released: 2 KeyPressed: d KeyTyped:F17 Key Released: D KeyPressed: g KeyTyped:F20 Key Released: G

Any solution to this pls?.

distechDeveloper avatar Jul 31 '17 07:07 distechDeveloper

NativeKeyEvent.getKeyText() does not take a key char, it takes a key code. You should just be able to do System.out.println("KeyTyped:" + e.getKeyChar());

kwhat avatar Jul 31 '17 17:07 kwhat

Working fine!! Thanks...

distechDeveloper avatar Aug 06 '17 10:08 distechDeveloper

Working fine!! Thanks...

Hi,

Above link is broken -

JNativeHook-2.1.1-rc -

https://oss.sonatype.org/content/repositories/snapshots/com/1stleg/jnativehook/2.1.SNAPSHOT/jnativehook-2.1.20170730.201417-33.jar

JNativeHook-2.0.4-rc -

https://oss.sonatype.org/content/repositories/snapshots/com/1stleg/jnativehook/2.0.SNAPSHOT/jnativehook-2.0.20170730.201637-41.jar

Currently I am using with java 8

    <dependency>
        <groupId>com.1stleg</groupId>
        <artifactId>jnativehook</artifactId>
        <version>2.1.0</version>
    </dependency>

Unfortunately Its also not working for me Could you please help me by sending the jar file because nativeKeyTyped is also not working for me. It throwing - Could not find keyboard map for locale 0X04090409!

@kwhat - Could you please help me how to get its resolve

Thanks & Regards, Vikas Gupta

vikku-vikasgupta avatar Nov 02 '19 16:11 vikku-vikasgupta

@vikku-vikasgupta Kwhat posted a new jar below. I'm about to test it out now. https://github.com/kwhat/jnativehook/issues/170#issuecomment-514874144

dmg46664 avatar Jan 09 '20 21:01 dmg46664

the above links are still broken , can someone tell us how to get the latest jar . thanks

achourali avatar May 28 '20 14:05 achourali

I am working on moving the builds and packages to github, you should be able to get nightly snapshots jars from github actions. The builds are hung up for windows on a maven cmake plugin bug that should be fixed in the next release of that plugin.

kwhat avatar May 28 '20 14:05 kwhat

Please test jnativehook-2.2-20210107.030301-37.jar I have done some refactoring to the function that is probably responsible for this issue but because I cannot reproduce the problem, I need one of you to test it and let me know if it is working. I still don't know exactly why this was an issue nor why I cannot reproduce it.

kwhat avatar Jan 07 '21 03:01 kwhat

Also had the described issue

Feb. 09, 2021 2:38:14 NACHM. org.jnativehook.GlobalScreen$NativeHookThread enable
SCHWERWIEGEND: refresh_locale_list [628]: Could not find keyboard map for locale 0X0000000004070407!

I did update to the newest snapshot on the maven sonatype repo (exact version is 2.2-20210107.030301-37):

    <repositories>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots><enabled>true</enabled></snapshots>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.github.kwhat</groupId>
            <artifactId>jnativehook</artifactId>
            <version>2.2-SNAPSHOT</version>
        </dependency>
    </dependencies>

Since then I never encountered the warning message again, so I would consider this as resolved.

Thank you for fixing this tedious issue, keep up the great work!

J0B10 avatar Feb 09 '21 13:02 J0B10