我正在使用vncdotool。当我测试下面的代码时,:变成;,我无法弄清楚它为什么这样做。另外,当我尝试发送〜时,它会发送`。任何帮助,将不胜感激。谢谢。Python vncdotool发送特殊字符
import vncdotool
from vncdotool import api
def sendKeys(client, keys):
for k in keys:
client.keyPress(k)
hostport = 'XXX.XXX.XXX.XXX::XXXX'
password = 'XXXXXXXXX'
client = api.connect(hostport, password)
command = 'add-apt-repository ppa:nilarimogard/webupd8'
sendKeys(client, command)
command = 'cd ~/myfolder/'
sendKeys(client, command)
好吧,这样的作品!谢谢!现在有另一个问题...有时当我发送命令,它发送全部大写,当然这些命令不能与CAPS ...任何想法,为什么? – antfuentes87
我的猜测是服务器缺少shift-release。一个可能的原因是因为服务器密钥缓冲区太小。如果是这样,在命令行中添加''--delay = 1000'''或在命令之间放置client.pause(1000)可能会有所帮助。 – Marc