GlobalScreen.postNativeEvent not working but NativeKeyListener detects keystroke
SiegfredRodriguez opened this issue · 0 comments
SiegfredRodriguez commented
Hello,
I'm trying to work on a remote control project, basically use media keys play,pause, etc... The find event seems to fire based off on the listener, however it's not having the intended effect of pausing/playing media playing in my browser which corresponding physical key does.
This is my code:
GlobalScreen.postNativeEvent(new NativeKeyEvent(NativeKeyEvent.NATIVE_KEY_PRESSED, 0, 240,NativeKeyEvent.VC_MEDIA_PLAY, NativeKeyEvent.CHAR_UNDEFINED));
Which i based off the output from the listener, no errors on the logs, and permissions are all seem to be set.
here are the details:
- MacOS Ventura 13.1
- JNativeHook 2.2.2
- Using M1 silicon
- Using intellij as debug run editor.