sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #19375
Re: [Question #232802]: How to control function calls in sikuli event handlers
Question #232802 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232802
RaiMan posted a new comment:
on top you might define different handlers for each region, that might
give you additional options:
def onAppear1(event):
print "appeared in region 1"
# add specifics for this region
onAppearAction(event)
def onAppear2(event):
print "appeared in region 2"
# add specifics for this region
onAppearAction(event)
def onAppear3(event):
print "appeared in region 3"
# add specifics for this region
onAppearAction(event)
def onAppearAction(event)
test = ABC()
global priority, myLock
myLock.acquire()
priority += 1
print "Captured the event", priority
if priority == 1:
test.add()
elif priority == 2:
test.subtract()
else:
test.multiply()
myLock.release()
class ABC(object):
def waitforEvent():
reg1 = Region(212,274,43,41)
reg2 = Region(212,316,43,40)
reg3 = Region(212,360,43,41)
reg1.onAppear("image.png", onAppear1)
reg1.observe(60,background=True)
reg2.onAppear("image.png", onAppear2)
reg2.observe(60,background=True)
reg3.onAppear("image.png", onAppear3)
reg3.observe(60,background=True)
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.