how does observeEvent work exactly ?
So ive been reading the sikuliX api on observing events and Im not able to understand certain events that happen when i try coding it out myself.
I wrote this function that clicks a region, and after the click will observe that region for any change in pixels.
def observe_
pixel_
phone_
phone_
this is the handler function for the above.
def handler(event):
global i
r = event.getRegion() # get the observing region for this event
path = capture(
i += 1
print(path)
r.stopObser
So every click of an event would trigger the handler function once since at the end of the handler function i make the observation stop. However my message log prints something like this:
[log] CLICK on L(55,109)@S(0)[0,0 1440x900] (109 msec)
/Users/
/Users/
/Users/
[log] CLICK on L(75,109)@S(0)[0,0 1440x900] (101 msec)
/Users/
/Users/
/Users/
/Users/
where i get like 3 - 4 print statements for every click i make ? shouldnt Stopobserver() cause the handler to be called once per observe_and_click function call ? I have already tried reading the documentation but i cant seem to find any information that could explain this phenomenon.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- ONG YI CHONG
- Solved:
- Last query:
- Last reply: