How To Press <CTRL>

自作多情 提交于 2019-12-19 08:20:21

问题


from pywinauto import application
app = application.Application.start("C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.exe")
app.Microsoft_Excel.TypeKeys('%a')

%a = Alt + a

I Want Ctrl + a. is there a sign for this?


回答1:


You must use Control key specifier - ^, so try:

app.Microsoft_Excel.TypeKeys('^a')

You can get documentation on SendKeys mini-syntax here or here.




回答2:


U can use: send_keys('^a')



来源:https://stackoverflow.com/questions/12056590/how-to-press-ctrl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!