Closed TejasPatadiya10 closed 7 months ago
Because VNCDoToolClient
does not have a method named type
;
type
is a command implemented by only by the CLI wrapper vncdotool.command.
If you want to use the API directly yourself, see documenation using client.keyPress(…)
.
Hey ,
Thanks for looking into it.
As per your suggestion of keypress , i tried below :
client = api.connect('server') client.keyPress('enter') client.captureScreen('screenshot.png') client.keyPress('cmd')
but it again gives me error:
ord() expected a character, but string of length 3 found
I wanted to open command prompt and run commands in another machine using VNC Session , can anyone please help me out ?
Thanks
Again: RTFM! keyPress works on single keys, e.g. a single character. To type a string you have to press multiple keys.
And be warned: there is not a single mapping from "character" to "key": to type some characters you have to press Shift/Alt/Ctrl/Compose/… keys before pressing a key and then releasing them again in the (correct) order. That is a deficiency of VNC; see https://github.com/sibson/vncdotool/issues/269#issuecomment-1696847993 for details
I am using python 3.11 with vncdotool and following is my code
I am getting below error on
client.type('cmd')
: