Keystroke Client Event Script - KeyCode Hex Values

Try sending the higher hex values for weird key codes, and see if you can catch them with a KeyboardFocusManager hook:

KeyboardFocusManager.getCurrentKeyboardFocusManager()
  .addKeyEventDispatcher(new KeyEventDispatcher() {
      @Override
      public boolean dispatchKeyEvent(KeyEvent e) {
        System.out.println("Got key event!");
        return false;
      }
});

You’ll have to translate the Java to Jython, but it’s not that hard - make a new Python class that inherits from KeyEventDispatcher and contains a dispatchKeyEvent function - you’ll need to import KeyboardFocusManager and KeyEventDispatcher from their respective Java packages as well.

1 Like