← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #235378]: How to use Wait() or Click() with multi screens?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Since we basically are in a Java environment, you would be supposed to write each function as
someRegion.function()

where someRegion is a Region object you have defined before and function
is one out of click, wait, find, ...

On Sikuli's script level it is only a convenience feature, that you can
say

click(someImage)

and internally Sikuli will search the whole screen of the primary
monitor (the one having the (0,0) as its top left corner)

This is what Sikuli will do with your click:

SCREEN = Screen(0) # done at initialization of Sikuli
.... 
SCREEN.click(someImage)

Be aware: SCREEN is a quasi constant and should not be changed by you.
Especially saying SCREEN = Screen(1) will not work.

Currently, if you want to click on another monitor than the primary, yo
have to say

s1 = Screen(1) # once at the beginning
...
s1.click(someImage)

same goes for 
someRegion.click(someImage)
if the region lies on monitor 1 (e.g. the window of some app)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.