[1.1.0] Hotkey handlers do not properly clean up
Bug #1566637 reported by
Sam Gleske
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Opinion
|
Undecided
|
RaiMan |
Bug Description
OS: Mac OS X El Capitan 10.11.3 (15D21)
Sikuli 1.1.0
When you cancel a script use CMD+SHIFT+C (Mac) the Hotkeys remain active.
e.g.
#START SCRIPT
def doClick(
last_
click(
mouseMove(
def click_location(
doClick(
Env.addHotkey('1', 0, click_location)
#END SCRIPT
Now run the sikuli script. If you cancel the script with CMD+SHIFT+C pressing the number 1 key will still execute the hotkey. I believe this should Env.removeHotkey all of the registered hotkeys if the script is canceled.
To post a comment you must log in.
tested with same environment:
why do you think, the hotkeys are not reset?
--- this is my test:
Debug.on(3)
def handler(e):
print "***** in handler"
Env.addHotkey('1', 0, handler)
for i in range(20):
print "*** lap:", i
wait(1)
--- and this is the output
[debug] Jython: requested to use as default region: R[0,0 1280x800]@S(0)
[debug] JythonScriptRunner: runPython: running script from IDE: raimundhocke/ Desktop/ SikuliX/ testFFHandler. sikuli
/Users/
[debug] HotkeyManager: add Hotkey: 1 (49, 0)
*** lap: 0
*** lap: 1
*** lap: 2
*** lap: 3
[debug] AbortKey was pressed
[debug] AbortKey was pressed, but nothing to stop here ;-)
[debug] Sikulix: cleanUp: 0
java.lang. InterruptedExce ption: sleep interrupted script. Sikulix. cleanUp( Sikulix. java:485) ide.SikuliIDE$ ButtonRun$ 1.run(SikuliIDE .java:2385)
.... more traceback (fixed in 1.1.1)
at org.sikuli.
at org.sikuli.
[debug] HotkeyManager: reset - removing all defined hotkeys.
[debug] removed (49, 0)