Dragonfly Mouse pointer gymnastics without clicking

If you are not fond of clicking the mouse, and just in case you do not already know... The ability included in Dragonfly (and others) to hold down the left mouse button is an ultra-simple and powerful tool. It looks like this in Dragonfly code.

  "from":#begin selection
    Mouse("left:up")+
    Mouse("left:down")+
    PlaySound(r"D:\files\wav\special effects\beep.wav"),

The "left up" command is used with most of my scripts, in order to make sure that the left mouse button is released.

That tiny simple "from" command is useful for many of my scripts. Another is simply clicking the left mouse button.

  "place":
    Mouse("left:up")+
    Mouse("left")+
    Pause("20")+
    PlaySound(r"D:\files\wav\special effects\beep.wav"),

I just noticed combining those two commands makes for exceptionally easy repositioning of Windows. Place the mouse pointer on the title bar and say "from", very easily move the pointer without holding the mouse button, and then say "place" to end the window placement. Also... For moving a window border... For menu choices that adhere to protocol (that is, click and drag to the choice before releasing the mouse button)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Chuck Runquist's picture

Quote: I just noticed

Quote:

I just noticed combining those two commands makes for exceptionally easy repositioning of Windows. Place the mouse pointer on the title bar and say "from", very easily move the pointer without holding the mouse button, and then say "place" to end the window placement. Also... For moving a window border... For menu choices that adhere to protocol (that is, click and drag to the choice before releasing the mouse button)

Xanadu,

Just FYI, the capabilities to which you refer already exist in DNS without the necessity to invoke them using either Vocola or Dragonfly.

These exist for both the right button in the left button and also include clicking and dragging any object "upper right", "upper left", "lower left", "lower right", among other related mouse movement commands.

Chuck Runquist
Owner, GEMCCON - The Choice of Intelligence
Speech Recognition Consulting and Training

There is nothing so useless as doing efficiently that which should not be done at all. - Peter Drucker

Can you provide example

Can you provide example code?

A large majority of my systemwide scripting in windows involves Continuous Command Recognition. I know that DNS Advanced Scripting cannot do that, but I also do not recall it being able to hold the mouse button down. Please jog my memory about the mouse button down.

Chuck Runquist's picture

Xanadu, First, I'm not aware

Xanadu,

First, I'm not aware of any restrictions in Advanced Scripting for holding down the mouse keys. I'm not going to go into detail here, but one example is the following:

Option Explicit

Type POINTAPI 'Declare types
x As Long
y As Long
End Type

Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long 'Declare API

Dim z As POINTAPI 'Declare variable

Sub Main
GetCursorPos z 'Get Coordinates
SendKeys "+{ClickLeft " & z.x &"," & z.y &"}",1
End Sub

This command holds down the Shift key while left clicking the mouse. Where it is useful is when you have highlighted a selection in a list and you want to select all of the items in the list down to a particular point. In essence, it functions the same as holding down the Shift key and selecting the desired item with the left mouse click (manual). It has a sister command that performs the first function of holding down the Ctrl key and performing a left mouse click to highlight the first item in the list. In combination, these two can be used to select noncontiguous individual items in a list or an entire collection of contiguous items. The only difference between the code above and the Ctrl key command is that the + is replaced with the ^.

These commands were created many versions ago.

As regards the mouse commands, open the Command Browser and search on "drag". Make sure that you select the lowercase "drag" if you see both "drag" and/or "Drag". You will find a whole string of Natural Language Commands that allow you to do the same things as the dragonfly commands with regard to mouse movements and dragging objects using the left and right mouse buttons. It would take a couple of pages to explain what each one does, so I'm not going to go into them here. However, most of them are fairly obvious.

Chuck Runquist
Owner, GEMCCON - The Choice of Intelligence
Speech Recognition Consulting and Training

"It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so." -- Mark Twain

GetCursorPos? Obviously I

GetCursorPos?

Obviously I was using the wrong manual.

Windows API

Thanks, Chuck, I was looking for this one recently.

Xanadu, the function comes from the Windows API.

For pushing the mouse down, you can use:

Sub Main
GetCursorPos z 
SendKeys "{DownLeft " & z.x & "," & z.y & "}", True
End Sub

Like wise {UpLeft...} etc.

mouse mark
With regards to your remark about the "drag" commands that are built in as natural language commands, you must also tell they only work after a "RememberPoint" call, for example by saying "mouse mark".

Greetings, Quintijn

Chuck Runquist's picture

Quintijn, That's partially

Quintijn,

That's partially true, but not entirely the case. For example, if you position the mouse either by voice or manually by hand so that the mouse pointer is in the title bar of a particular window and you then say "mouse left drag lower right" it will grab the title bar of the window and move it. The same occurs with regard to text in a document. And then you can use these commands to drag it anywhere that you want. They also work with both the left button and the right button in terms of what those buttons do.

There is no need to issue a RememberPoint call unless you want to move the mouse to a particular location by voice command. Nevertheless, the mouse will grab and drag an object as long as the mouse pointer is anywhere inside of the drag point without having to issue any extra commands. I use these commands all the time and never have had to do that. In fact, these Natural Language Commands originally came from L&H VoiceXpress and are documented in a book that was provided to colleges and universities for training students in speech recognition which I helped write along with working with the natural language development team, which is the same team that is currently writing the Natural Language Commands for Dragon NaturallySpeaking. So, they been around for a long time.

Chuck Runquist
Owner, GEMCCON - The Choice of Intelligence
Speech Recognition Consulting and Training

"It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so." -- Mark Twain

Quintijn wrote: Xanadu, the

Quintijn wrote:

Xanadu, the function comes from the Windows API

well yeah, I have used GetCursorPos in my Visual C++ macro recorder... but I never saw/found anything about saving the current pointer position in the DNS Advanced Scripting documentation... too late (for me) now

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Syndicate content