Well all right then ;-)
With Dragon loaded say: 'add new command'
Command Type is: Advanced Scripting
Delete the default Sub Main/ End Sub lines in the script part.
Now paste the following:
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, _
ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, _
ByVal dwExtraInfo As Long)
Type POINTAPI 'Declare types
x As Long
y As Long
End Type
'
Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long 'Declare API
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN = &H20
Const MOUSEEVENTF_MIDDLEUP = &H40
Const MOUSEEVENTF_RIGHTDOWN = &H8
Const MOUSEEVENTF_RIGHTUP = &H10
Sub Main
Dim z As POINTAPI 'Declare variable
Dim xpos As Long, ypos As Long
GetCursorPos z 'Get Coordinates
xpos = CLng(z.x)
ypos = CLng(z.y)
If ListVar1 = "Release" Then
Select Case ListVar2
Case "Left"
mouse_event MOUSEEVENTF_LEFTUP, xpos, ypos, cButt, dwEI
Case "Right"
mouse_event MOUSEEVENTF_RIGHTUP, xpos, ypos, cButt, dwEI
Case "Center", "Middle"
mouse_event MOUSEEVENTF_MIDDLEUP, xpos, ypos, cButt, dwEI
End Select
Else
Select Case ListVar2
Case "Left"
mouse_event MOUSEEVENTF_LEFTDOWN, xpos, ypos, cButt, dwEI
Case "Right"
mouse_event MOUSEEVENTF_RIGHTDOWN, xpos, ypos, cButt, dwEI
Case "Center", "Middle"
mouse_event MOUSEEVENTF_MIDDLEDOWN, xpos, ypos, cButt, dwEI
End Select
End If
End Sub
Then click on the Name Editor button. The command name is:
These are the two lists this command uses. Currently they are empty.
Double-click the first one (leftrightcenter) in the 'Lists used in this command' section and type the following:
Center
Left
Middle
Right
Now double-click the one right below (releasehold) and type:
Hold
Release
Confirm with OK
Finally click SAVE to save your command.
Now the command should work and you can issue the following commands:
Hold Left
Release Left
Hold Right
Release Right
Hold Center
Hold Middle
Release Middle
Did you check out my Easy Guide to Dragon scripting? It explains all these things in a very easy to understand manner:
Rob.
<edited><editID>Speech1965</editID><editDate>2018-01-17 19:17:58</editDate></edited>