使用Dragon NaturallySpeaking的高级脚本发送键盘组合RWIN + shift + left

时间:2017-06-29 22:51:55

标签: windows keyboard-shortcuts multiple-monitors naturallyspeaking

我正在尝试编写一个脚本,可以发送键盘组合 RWIN + shift + left 将所选窗口移动到监视器在左边,使用Dragon NaturallySpeaking的高级脚本。

RWIN 对应右侧窗口键:

enter image description here

我试过了:

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)
Wait(.2)
SendKeys "+({Left})"
Wait(.2)
keybd_event(VK_RWIN,0,2,0)
End Sub

但是这会发送 shift + left ,然后是 RWIN

1 个答案:

答案 0 :(得分:1)

可能会将等待标志添加到SendKeys指令。在这种情况下,可能不需要单独的Wait步骤(我将它们评论出来)。尝试:

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)
    ' Wait(.2)
    SendKeys "+({Left})", 1  ' 1 = wait is true
    ' Wait(.2)
    keybd_event(VK_RWIN,0,2,0)
End Sub

H个