Changing default screen

Asked by Niklas Jørgensen

Is there any way in sikulix that changes the default monitor so that the click()/wait() etc. functions works on that one instead of the default SCREEN object that (in my case atleast) always refers to Screen(0).

So, what i'm after is a method like Screen.setDefaultMonitor(1) to set the default monitor to 1 for the rest of the script so i dont have to make a screen1 = Screen(1) and then work with screen1.click() all the way through?

Thanks for looking :)

Question information

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

use(Screen(1)) # switches default to 2nd screen
hover() # should move mouse to middle of 2nd screen
# more
use() # switches back to first screen

tested with SX 2.0.5 on Win11

Revision history for this message
Niklas Jørgensen (shortytheman) said :
#2

Thanks RaiMan, that solved my question.