VNCScreen => How to click ?

Asked by David ENJOLRAS

Following code works well until I try the click:
I can see the mouse on the MAIN screen moving & clicking, not the one in the VNC session :-(
( You can see in trace what the click is done on the main screen )

Does vnc.click() is implemented ?
------------------------------------------------------------------------------

import shutil
import os

print ('Establish a VNC connection to %s on port %d' % ("frlesvmhostqa02",9105) )

import java.net.Socket as Socket
import edu.unh.iol.dlc.ConnectionController as ConnectionController

s = Socket("frlesvmhostqa02", 9105); #open a socket to vnc server on listening port
s.setSoTimeout(1000);
s.setKeepAlive(1); #some socket configuration

SocketList = []
SocketList.append(s)

cc = ConnectionController(SocketList);
cc.openConnection(0); #opens the vnc connection for connection 0, multiple are supported
cc.setPixelFormat(0, "Truecolor", 32, 0); #for connection 0, set pixel data to Truecolor, 32 bits per pixel, little endian
cc.start(0); #start thread that keeps BufferedImage updated by polling server for remote desktop changes

Sikuli.wait(2); #wait for buffered image to be updated before we do sikuli

import edu.unh.iol.dlc.VNCScreen as VNCScreen
vnc = VNCScreen()
print('Main Screen size is %d,%d' % (Region(SCREEN).getW(),Region(SCREEN).getH() ))
print('VNC Screen size is %d,%d' % (vnc.getW(),vnc.getH() ))

vnc.showMonitors()

test = vnc.find("Next.png")
Larger = test.nearby(100)
img = vnc.capture(Larger)
shutil.move(img.getFile(), "f:/temp/test.png")

print ('BBBBBBBBBBBBBBBBBBBBBBB')
click(test)
print ('CCCCCCCCCCCCCCCCCCCCCCC')
vnc.click(test)
print ('DDDDDDDDDDDDDDDDDDDDDDD')

--------------------------------------------
output :

Establish a VNC connection to frlesvmhostqa02 on port 9105

Main Screen size is 1680,1050
VNC Screen size is 1280,768
[info] *** monitor configuration [ 1 VNCScreen(s)] ***
[info] *** Primary is VNCScreen 0
[info] Screen 0: S(0)[0,0 1280x768]
[info] *** end monitor configuration ***
AAAAAAAAAAAAAAAAAAAAAAA

BBBBBBBBBBBBBBBBBBBBBBB
[log] CLICK on L(885,589)@S(0)[0,0 1680x1050]

CCCCCCCCCCCCCCCCCCCCCCC
[log] CLICK on L(885,589)@S(0)[0,0 1680x1050]

DDDDDDDDDDDDDDDDDDDDDDD

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
David ENJOLRAS (david-enjolras) said :
#1

Seems a
SCREEN = VNCScreen()
may help,
but still not working...

Revision history for this message
RaiMan (raimund-hocke) said :
#2

should work now with the next 1.1.1 nightly (see the related bug)

Can you help with this problem?

Provide an answer of your own, or ask David ENJOLRAS for more information if necessary.

To post a message you must log in.