1

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

RWIN对应右windows键:

在此处输入图像描述

我试过了:

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.

4

1 回答 1

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

Hth

于 2017-06-30T20:22:39.157 回答