Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Posting Native Events for Some Numpad Digits doen't work #62

Closed
cypressious opened this issue Aug 23, 2015 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@cypressious
Copy link

I'm writing an application that automatically converts some letters into special unicode characters (namely cyrillic letters). My approach is the following:

  1. Catch and suppress original letter event
  2. Press and Hold Alt by posting a native event
  3. Type the decimal unicode value on the keypad by posting native events
  4. Release Alt by posting a native event

When I do that, I get some unwanted extra events, but I can just catch and suppress those. However, when I send an event for the keypad digit 4 like so:

GlobalScreen.postNativeEvent(new NativeKeyEvent(
        NativeKeyEvent.NATIVE_KEY_PRESSED,
        System.currentTimeMillis(),
        NativeInputEvent.ALT_L_MASK,
        0,
        NativeKeyEvent.VC_KP_4,
        NativeKeyEvent.CHAR_UNDEFINED,
        NativeKeyEvent.KEY_LOCATION_NUMPAD))

I instead get an event for the left arrow key: NATIVE_KEY_PRESSED,keyCode=57419,keyText=Links,keyChar=Undefiniert,modifiers=Alt,keyLocation=KEY_LOCATION_STANDARD,rawCode=37 ("Links" is German for "Left arrow"). Similar things happen for the digits 5, 7 and 8.

Interestingly, the digits 0, 1, 2, 3, 6 and 9 work flawlessly.

I'm using version 2.0-20150624.234945-1.

@kwhat kwhat added the bug label Aug 23, 2015
@kwhat kwhat added this to the 2.0.3 milestone Aug 23, 2015
@kwhat kwhat self-assigned this Aug 23, 2015
@kwhat
Copy link
Owner

kwhat commented Oct 9, 2015

I think I found the problem, let me know if this build works:

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

I didn't test anything besides the keys that weren't working, so please try as many as convent.

@kwhat
Copy link
Owner

kwhat commented Oct 16, 2015

I am pretty sure this has been resolved.

@kwhat kwhat closed this as completed Oct 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants