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

GlobalScreen.postNativeEvent not working but NativeKeyListener detects keystroke #430

Open
SiegfredRodriguez opened this issue Jan 4, 2023 · 0 comments

Comments

@SiegfredRodriguez
Copy link

SiegfredRodriguez commented Jan 4, 2023

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant