onChange -> find WHERE it changed

Asked by Marc on 2017-01-03

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:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2017-01-03
Last reply:
2017-01-03

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.