// TODO: ctrl etc static bool onGlobalHotKey(S hotKey, fO r) { if (empty(hotKey)) false; final Int keyCode = mapGet(jNativeHook_keyCodes(), upper(hotKey)); if (keyCode == null) ret false with print("Ignoring unknown hotkey: " + hotKey); onGlobalKeyPress(voidfunc(NativeKeyEvent e) { if (e.getKeyCode() == keyCode && e.getModifiers() == 0) callF(r); }); print("Hotkey registered: " + hotKey); true; }