Exit Sikuli in JavaAPI using HotkeyManager

Asked by Patrick

Hi,,

I tried to understand the HotkeyManager on Windows, but i didn't found a good example.

I would close the Java programm with the sikuli HotkeyManager by Type CRTL-ESCAPE. Is there a good example how to do it?

Greetz Patrick

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

HotkeyManager.getInstance().addHotkey(Key.ESC, KeyModifier.CTRL, new HotkeyListener() {
    @Override
    public void hotkeyPressed(HotkeyEvent e) {
      System.exit(0);
    }
});

Can you help with this problem?

Provide an answer of your own, or ask Patrick for more information if necessary.

To post a message you must log in.