onChange -> find WHERE it changed

Asked by Marc

Hi, I recently started to use onChange() and observe(), and I don't totally get them...

I want to observe my screen, and when it detects a change, move the cursor to that position.

For now the only thing I made is :
#############################
def Fleche_Trouve(event):
            sleep(4)
            print ("ok")

onChange(50,Fleche_Trouve)
observe(2,background=False)
stopObserver()
#############################

It just prints "ok" when something change... but I have to add a "sleep(4)" inside because without it will print multiple "ok"

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Can you help with this problem?

Provide an answer of your own, or ask Marc for more information if necessary.

To post a message you must log in.