3 ms·
I think [jnativehook](https://github.com/kwhat/jnativehook https://github.com/kwhat/jnativehook), is one good route. Now I just have to find the right scripting
by profalseidol 10y ago
I think [jnativehook](https://github.com/kwhat/jnativehook https://github.com/kwhat/jnativehook), is one good route. Now I just have to find the right scripting language and package java as self extracting 16mb 7zip.
```
import org.jnativehook.GlobalScreen;
import org.jnativehook.NativeHookException;
import org.jnativehook.keyboard.NativeKeyEvent;
import org.jnativehook.keyboard.NativeKeyListener;
public class GlobalKeyListenerExample implements NativeKeyListener {
public void nativeKeyPressed(NativeKeyEvent e) {}
public void nativeKeyReleased(NativeKeyEvent e) {}
public void nativeKeyTyped(NativeKeyEvent e) {
System.out.println("Key Typed: " + e.getKeyText(e.getKeyCode()));
}
public static void main(String[] args) throws NativeHookException {
GlobalScreen.registerNativeHook();
GlobalScreen.addNativeKeyListener(new GlobalKeyListenerExample());
}
}
```