[1.0.1] MultiMonitor: Highlight doesn't work correctly with several screens
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
In Progress
|
High
|
obiwan-92 |
Bug Description
Hey, I'm pretty new to Sikuli but am struggling with this multiple monitor thing. I've looked through other posts and didn't quite find an answer. I'm running Windows 7 (maybe that's the problem!) and have a laptop with an external monitor. My external monitor is my primary desktop with the Start bar at the bottom and my laptop sits to the left. When I run the code below, it tells me that I have 2 monitors, but I can't get it to select a region over on my laptop screen. And in the line "scr=Screen(0)" the word Screen is red which tells me that it doesn't recognize that class name or something (I'm using the IDE by the way). I've also tried Screen(1) and Screen(2) with no change. It allows me to select a region on my primary external monitor but never on my laptop screen:
def changed(event):
for ch in event.changes:
sleep(1)
for ch in event.changes:
ns = getNumberScreens()
popup("Number of screens = " + str(ns))
scr=Screen(0)
r = scr.selectRegio
# any change in r larger than 50 pixels would trigger the changed function
r.onChange(50, changed)
r.observe(5, background=False)
r.stopObserver()
popup("Done looking")
Changed in sikuli: | |
status: | New → Incomplete |
Changed in sikuli: | |
assignee: | nobody → obiwan-92 (obiwan-92) |
Changed in sikuli: | |
status: | Confirmed → Fix Committed |
importance: | Undecided → High |
assignee: | obiwan-92 (obiwan-92) → RaiMan (raimund-hocke) |
milestone: | none → 1.1.0 |
Changed in sikuli: | |
status: | Fix Committed → In Progress |
Hello.
Resume :
When I use the following code, the highlight area show an image coming from the screen 0 when it should be an image from the screen 1.
r = Region( Screen( 1).getBounds( ))
ch.highlight( 3) # highlight all changes for 3 sec.
print "Region : ", r
def changed(event):
print "Event : ", event
for ch in event.changes:
print "Changes : ", ch
r.onChange(50, changed)
r.observe(10, background=False)
Regards.