class MyHotkeyHandler implements jxgrabkey.HotkeyListener {
    public void onHotkey(int id) {
      Debug.log(4, "Hotkey pressed");
      HotkeyData data = _idCallbackMap.get(id);
      HotkeyEvent e = new HotkeyEvent(data.key, data.modifiers);
      data.listener.invokeHotkeyPressed(e);
    }
  }

  ;

  private Map<Integer, HotkeyData> _idCallbackMap = new HashMap<Integer, HotkeyData>();
  private int _gHotkeyId = 1;

  public boolean _addHotkey(int keyCode, int modifiers, HotkeyListener listener) {<FILL_FUNCTION_BODY>

    JXGrabKey grabKey = JXGrabKey.getInstance();

    if (_gHotkeyId == 1) {
      grabKey.addHotkeyListener(new MyHotkeyHandler());
    }

    _removeHotkey(keyCode, modifiers);
    int id = _gHotkeyId++;
    HotkeyData data = new HotkeyData(keyCode, modifiers, listener);
    _idCallbackMap.put(id, data);

    try {
      //JXGrabKey.setDebugOutput(true);
      grabKey.registerAwtHotkey(id, modifiers, keyCode);
    } catch (HotkeyConflictException e) {
      Debug.error("Hot key conflicts");
      return false;
    }
    return true;
  
<methods>public non-sealed void <init>() ,public abstract boolean _addHotkey(int, int, org.sikuli.basics.HotkeyListener) ,public abstract int _removeAll(Map<java.lang.String,java.lang.Integer[]>, boolean) ,public abstract boolean _removeHotkey(int, int) ,public boolean addHotkey(java.lang.String, org.sikuli.basics.HotkeyListener) ,public boolean addHotkey(char, int, org.sikuli.basics.HotkeyListener) ,public boolean addHotkey(java.lang.String, int, org.sikuli.basics.HotkeyListener) ,public abstract void cleanUp() ,public java.lang.String getHotKeyText(java.lang.String) ,public static org.sikuli.basics.HotkeyManager getInstance() ,public boolean removeHotkey(java.lang.String) ,public boolean removeHotkey(char, int) ,public boolean removeHotkey(java.lang.String, int) ,public static void reset(boolean) <variables>private static final java.lang.String HotkeyTypeAbort,private static int HotkeyTypeAbortKey,private static int HotkeyTypeAbortMod,private static final java.lang.String HotkeyTypeCapture,private static int HotkeyTypeCaptureKey,private static int HotkeyTypeCaptureMod,private static org.sikuli.basics.HotkeyManager _instance,private static Map<java.lang.String,java.lang.Integer[]> hotkeys,private static Map<java.lang.String,java.lang.Integer[]> hotkeysGlobal