← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #676720]: How exactly does onChange() work

 

Question #676720 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/676720

    Status: Open => Answered

RaiMan proposed the following answer:
Internally the observe simply is a loop, that constantly compares the last screenshot with the current screenshot to detect changes.
If changes are detected, the handler is visited as part of the loop workflow.
Hence detection is paused until the return from the handler.

In the first place, the detection rate (loops per second) mainly depends
on the region size (complete screen = slow, small region = fast).

On modern systems the scan rate should be 1 - 2 per second for whole screen.
With smaller regions, it might be more than 10 per second.

---  What if there are transition effects during the onChange method
changes happening on the screen while in handler are not seen.
The next check is the screen/region after leaving the handler against the screen/region before entering the handler.

There are features available to influence the timing - see docs.

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