如何使用Dragon NaturallySpeaking的高级脚本发送正确的windows密钥?

看看What is the difference between the commands SendKeys, SendSystemKeys or SendDragonKeys?,这在SendKeys、SendSystemKeys或SendDragonKeys上似乎是不可能的。
发布于 2017-06-28 09:43:40
按正确的Windows键:
' From https://knowbrainer.com/forums/forum/messageview.cfm?catid=3&threadid=3032
' Author: monkey8
' Tested with Dragon NaturallySpeaking 12.5 with Windows 7 SP1 x64 Ultimate
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
Const VK_RWIN = 92
Sub Main
keybd_event(VK_RWIN,0,0,0)
'if you want to send a key while holding down the Windows key then insert the code here
keybd_event(VK_RWIN,0,2,0)
End Sub按向左Windows键:
' From https://knowbrainer.com/forums/forum/messageview.cfm?catid=3&threadid=3032
' Author: monkey8
' Tested with Dragon NaturallySpeaking 12.5 with Windows 7 SP1 x64 Ultimate
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
Const VK_LWIN = 91
Sub Main
keybd_event(VK_LWIN,0,0,0)
'if you want to send a key while holding down the Windows key then insert the code here
keybd_event(VK_LWIN,0,2,0)
End Sub键盘代码的有用参考:List of Virtual Key Codes (mirror)
发布于 2019-11-09 13:12:49
注意:在脚本中,Declare内容必须位于Sub Main之上。如果你使用修改键,它看起来会是这样的:
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
Const VK_LWIN = 91
Sub Main
keybd_event(VK_LWIN,0,0,0)
SendSystemKeys "{Right}"
keybd_event(VK_LWIN,0,2,0)https://stackoverflow.com/questions/44792305
复制相似问题