Reputation: 83167
I am trying to write a script that can send the keyboard combo RWIN + shift + left to move the selected window to the monitor to the left, with Dragon NaturallySpeaking's advanced scripting.
RWIN corresponds to the right windows key:
I tried:
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
But this sends shift + left followed by RWIN.
Upvotes: 1
Views: 370
Reputation: 2312
Maybe add the wait flag to the SendKeys
instruction. In that case, separate Wait
steps may not be needed (and I commented them out). Try:
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
Upvotes: 1