New question #694589 on Sikuli:
https://answers.launchpad.net/sikuli/+question/694589

I start the program in Sikuli-IDE, it does what it supposed to do. I press the 
ctrl-F12 to end the program and the program stops as expected, sadly the code 
window Sikuli doesn't appear until I quit and restart Sikuli. I tried also with 
break-key (ctrl-cmd-C) and same result. All the menus of Sikuli are available, 
yet they do not do anything, and the code window doesn't display until Sikuli 
is restarted.

Sometimes it crashes after I press a menu of Sikuli (after the code execution 
is terminated and Sikuli doesn't reappear). I haven't been able to determine 
what makes that every so often it crashes.

Sometimes the menus are not available at all (except the Sikuli one) after the 
code execution is terminated and Sikuli doesn't reappear. I haven't been able 
to determine what makes that every so often it becomes unresponsive and need to 
terminate the program.

Additionally, if I comment out the command wd.observe(), then I can start and 
end the code as expected, but not when it executes!

Sikuli 2.0.4
MacOS 11.1

This is my test code:
bs = App.focus("testApp")
global wd
wd = bs.window()

def breakHandler(event):
    global loopctl
    loopctl = False

def clickevent1(event):    
    global e1
    global e2
    print("Event1", event.getCount())
    ar = event.getRegion()
    ar.hover()
    wait(2)
    ar.setInactive(e1)
    ar.setActive(e2)

def clickevent2(event):    
    global e1
    global e2
    print("Event2", event.getCount())
    ar = event.getRegion()
    ar.hover()
    wait(2)
    ar.setInactive(e2)
    ar.setActive(e1)

global e1
global e2
e1 = wd.onAppear(Pattern("e1.png").similar(0.80), clickevent1)
e2 = wd.onAppear(Pattern("e2.png").similar(0.80), clickevent2)

Env.addHotkey(Key.F12, KeyModifier.CTRL, breakHandler)

wd.observe()

global loopctl
loopctl = True

while loopctl:
    wait(1)

wd.stopObserver()

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

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to