Skip to content

Instantly share code, notes, and snippets.

@sl5net
Created June 5, 2015 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sl5net/824ea1907aa29039ea39 to your computer and use it in GitHub Desktop.
Save sl5net/824ea1907aa29039ea39 to your computer and use it in GitHub Desktop.
sikuliX_multi_monitors_test15-06-05_09-59
n = getNumberScreens()
nNumverScreensExpected = 4
print (Env.getSikuliVersion() , " " , n , " monitors." )
for ScreenId in range(n):
print("----------------- ScreenId = ", ScreenId)
reg = Screen(ScreenId)
print("reg: x, y, w, h = ", reg.x , reg.y, reg.w, reg.h)
x = reg.x
y = reg.y
topLeft = Location(x, y) # equivalent to
topLeft = reg.getTopLeft()
botRight = reg.getBottomRight()
h = botRight.y - y
w = botRight.x - x
#reg.h = theWidth # equivalent to
#reg.setH(h)
#print(" x, y, w, h = ", x, y, w , h)
reg.setH(h)
reg.setY(y)
#print("")
print("reg: x, y, w, h = ", reg.x , reg.y, reg.w, reg.h)
#reg.setAsScreen()
# if ScreenId != 1:
# continue
reg.highlight(4) # dud red frame around for seconds
#reg.hover(3)
# reg.selectRegion("middle of region")
# SCREEN = reg
#Screen(0).setROI(reg)
# setROI(reg)
#mouse = new DesktopMouse()
# reg.setAutoWaitTimeout(100000)
#click("1432712960373.png")
if reg.exists("1432712960373.png"):
print("found at ScreenId = " , ScreenId)
reg.hover("1432712960373.png")
sleep(1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment