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

key.typed event returns [ 'Undefined' ] #14

Open
dkaraush opened this issue Jan 21, 2018 · 1 comment
Open

key.typed event returns [ 'Undefined' ] #14

dkaraush opened this issue Jan 21, 2018 · 1 comment
Labels

Comments

@dkaraush
Copy link

dkaraush commented Jan 21, 2018

I have tested simple code:
require("gkm").events.on("key.typed",console.log);
Output:

[ 'Undefined' ]
[ 'Undefined' ]
[ 'Undefined' ]

Node version: v8.6.0
NPM version: v5.3.0
java version: 1.8.0_91
javac version: 1.8.0_60
OS: Windows 7 (x64)

@tomzx
Copy link
Owner

tomzx commented Jan 24, 2018

If you run java -jar JNativeHook.jar (found in the lib/lib folder), you can see the data provided by JNativeHook. The issue is that the typed event does not have a keyCode (it returns 0). It does however return a keyChar and a rawCode which may be a bit more useful.

However, to fix this would require changing gkm-java so it is possible to either return all the values like JNativeHook does when you start the jar file.

Given I don't maintain this anymore, I'd suggest you use the key.pressed and key.released instead.

@tomzx tomzx added the bug label Jan 24, 2018
@tomzx tomzx closed this as completed Nov 10, 2018
@tomzx tomzx reopened this Nov 10, 2018
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