gkm icon indicating copy to clipboard operation
gkm copied to clipboard

key.typed event returns [ 'Undefined' ]

Open dkaraush opened this issue 7 years ago • 1 comments

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)

dkaraush avatar Jan 21 '18 21:01 dkaraush

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 avatar Jan 24 '18 17:01 tomzx