[1.1.0] Hotkey handlers do not properly clean up

Bug #1566637 reported by Sam Gleske on 2016-04-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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.


def doClick(some_location):
    last_mouse_location = Env.getMouseLocation()

def click_location(event):
    doClick(Location(100, 100))

Env.addHotkey('1', 0, click_location)

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.

RaiMan (raimund-hocke) wrote :

tested with same environment:

why do you think, the hotkeys are not reset?

--- this is my test:
def handler(e):
  print "***** in handler"

Env.addHotkey('1', 0, handler)

for i in range(20):
  print "*** lap:", i

--- 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:
[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.InterruptedException: sleep interrupted
.... more traceback (fixed in 1.1.1)
at org.sikuli.script.Sikulix.cleanUp(Sikulix.java:485)
at org.sikuli.ide.SikuliIDE$ButtonRun$1.run(SikuliIDE.java:2385)

[debug] HotkeyManager: reset - removing all defined hotkeys.
[debug] removed (49, 0)

Changed in sikuli:
status: New → Opinion
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.1
milestone: 1.1.1 → 1.1.0
summary: - Hotkey handlers do not properly clean up
+ [1.1.0] Hotkey handlers do not properly clean up
Sam Gleske (sam-mxracer) wrote :

Odd, I can't actually reproduce it with the script I gave you. However, for unknown reasons yet that's the behavior in my script.


To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers