控制键盘
1 2 3
| Set WShell = CreateObject("WScript.shell") WShell.SendKeys "r"
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| Set WShell = CreateObject("WScript.shell")
Sub sendKeyR()
WScript.Sleep 3000
WShell.SendKeys "{DOWN 10}"
Dim count count = 0 Do While count < 20 WShell.SendKeys "r" count = count + 1 Loop
Dim a a = 2 If a < 3 Then WShell.SendKeys "+(r)" ElseIf a > 3 Then WShell.SendKeys "q" Else WShell.SendKeys "w" End If
End Sub
sendKeyR()
WShell.appactivate("窗口名称")
WShell.Run "taskkill /im wscript.exe -f"
|
特殊字符
比如百分号是表示按住ALT键,如果想要直接发送百分号,需要用大括号包裹起来
控制鼠标
目前看来需要安装Excel 才能控制,
以后再写