kwhat/jnativehook

GlobalScreen.postNativeEvent Not Working When Windows Screensaver Is Active

Megatron1000 opened this issue · 0 comments

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));