← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #695667]: Issue with Hotkey

 

Question #695667 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/695667

    Status: Open => Answered

RaiMan proposed the following answer:
exit() cannot be used in the handler, since it stops the application
here (hence the IDE).

You have to tell the main script, that the hotkey was pressed simply
with a global variable:

def exitHotkey(event):
    global shouldStop
    Do.popup("stopping", 1)
    shouldStop = True

Env.addHotkey(Key.ESC, 0, exitHotkey)

shouldStop = False
while not shouldStop:
    wait(1)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.