kristian / system-hook

Global Keyboard / Mouse Hook for Java applications.
MIT License
270 stars 48 forks source link

Keyboard typing wrong keys #5

Closed guikaercher closed 8 years ago

guikaercher commented 8 years ago

I'm using you library for my Project to automate Support stuff.

When I type ´ it gives me ´´ instead, also when I type ~ it gives me ~~ .

My keyboard is PT-BR (ABNT) and I'm using Windows 10. Can you help me with that?

kristian commented 8 years ago

Can you help me with that?

Sure, let us try to solve your problem. :)

You have to provide me with a little more detail though. Could you please run the GlobalKeyboardExample and type a few characters inlcuding the mentioned ones? Please do paste the standard output here. Also, if possible, please paste your GlobalKeyListener snippet here.

guikaercher commented 8 years ago

Yeah, sure. I would appreciate any help :) .

So I ran the GlobalKeyboardExample class (I did import the already compiled .jar on releases). My keyboard layout is portuguese (Brazil) and when I type the " ´ " I'm getting two of them " ´´ " therefore I canot type like "é" or "á" because whenever I type that I got two of them.

This is the output I got: 219 [down] 219 [up]

I was Reading the c code and I guess I should change the language at "MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)". I'm installing cygwin for trying that today.

kristian commented 8 years ago

219 [down] 219 [up]

That's the expected output for your input. So there are no two " ´ ". Could you please be a little more specific, what do you mean with "I'm getting two of them"? Please paste a code snippet to reproduce the problem. The example code records only one key down and one key up, which is fine.

guikaercher commented 8 years ago

For being more specific I made a video: https://youtu.be/tA8Fr-sHnuI

Im running the example you made for keyboard.

I tried to compile the JNI stuff but I'm not sure how to do that. Wouls you mind to compile a version of your library with this paramater "MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)" changed to portuguese_brazil parameters? They are respectively: "LANG_PORTUGUESE" and "SUBLANG_PORTUGUESE_BRAZILIAN".

Thanks a lot!

kristian commented 8 years ago

Sorry for my late response, I hadn't had time to check on the issue last week. Just for your information. I was able to reproduce the problem and will now try to find out why this is happening. I'll let you know as soon as I know more. Thanks.

kristian commented 8 years ago

Fixed with 1a73f67adba6cbcecf4cf864cc97385591abda05 and version 2.5. Thank you!

guikaercher commented 8 years ago

Nice, will be testing soon and let you know. Thx for the fix.