jnativehook
jnativehook copied to clipboard
GlobalScreen.postNativeEvent Not Working When Windows Screensaver Is Active
I'm using jnativehook to trigger media keys on Windows.
Everything works perfectly until the Windows screensaver is active, at which point triggering the keys has no effect. It logs:
com.github.kwhat.jnativehook.GlobalScreen postNativeEvent
SEVERE: hook_post_event [244]: SendInput() failed! (0X5)
An example of a command I'm using is the following, to trigger volume down:
GlobalScreen.postNativeEvent(new NativeKeyEvent(2401, 0, 174, 57390, NativeKeyEvent.CHAR_UNDEFINED));