Author Topic: Best Way to Implement Mouse Movement Commands?  (Read 2391 times)

Stargazer

  • Guest
Best Way to Implement Mouse Movement Commands?
« on: January 08, 2019, 04:19:34 AM »
I only recently got Voice Attack, and I have fallen in love with it.  I have a repetitive stress injury in both arms, so I'm trying to use it to control everything (mouse included) for the time being and take some of the stress off of my hands.  The one type of command I can't figure out how to set up effectively is mouse control.  I can set it up so that my mouse moves, say, 10 pixels to the right, but I'm trying to figure out the best way to make it so I can control the mouse reasonably well without having to issue too many commands. 

Is there a way to set up the command so that I could say something like, "Move Right 100" to move 100 pixels, or "Move Right 25" to move 25 pixels?  It sounds like you can do it with the token/integer thing (or by setting up thousands of individual commands......), but I couldn't figure out how to use the token/integer stuff.  I know there are the coordinates too, but I worry that those would be tough to use...for example, if I try to move to "1000, 1000", and I really need to be at "990, 995", it would be frustrating!

Does anyone have any advice or help as to how best to implement mouse movement voice commands?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Best Way to Implement Mouse Movement Commands?
« Reply #1 on: January 08, 2019, 05:26:57 PM »
Is there a way to set up the command so that I could say something like, "Move Right 100" to move 100 pixels, or "Move Right 25" to move 25 pixels?

Move [left;right;up;down] [1;1..19,5;1..10,100]
Code: [Select]
Begin Text Compare : [{CMD}] Contains 'left'
    Move mouse left [{TXTNUM:"{CMD}"}] pixel(s) (from cursor position)
Else If Text Compare : [{CMD}] Contains 'right'
    Move mouse right [{TXTNUM:"{CMD}"}] pixel(s) (from cursor position)
Else If Text Compare : [{CMD}] Contains 'up'
    Move mouse up [{TXTNUM:"{CMD}"}] pixel(s) (from cursor position)
Else
    Move mouse down [{TXTNUM:"{CMD}"}] pixel(s) (from cursor position)
End Condition

You generally want to limit the amount of command phrases a command generates, so this command phrase will allow 1, 5 to 95 in steps of 5, and 100 to 1000 in steps of 100, generating 120 phrases instead of 4000.

I've set it up so the whole spoken command is searched for direction and number, so if you want to switch the elements around(E.G. "Move [1;1..19,5;1..10,100] pixels to the [left;right;up;down]") it will still function.

The command is attached to this post so you can import it directly.


Does anyone have any advice or help as to how best to implement mouse movement voice commands?

For a full mouse substitute for normal desktop use(I.E. not in games), I have to recommend the built-in Windows Speech Recognition app.

It can click many UI elements by name, or show numbers on top of them so you can speak the numbers(scroll to the "Commands for Windows and apps" section), and it can show a grid onscreen so you can move to a given square(scroll to "Commands for using the mouse").

However, because VoiceAttack and this app both need to use the microphone, and perform actions in response to voice commands, it is not recommended to run them simultaneously. You can certainly try, but things may not work as expected.
« Last Edit: January 19, 2021, 02:08:32 PM by Pfeil »