Author Topic: Mouse Screen Coordinate Token?  (Read 285 times)

scottb613

  • Newbie
  • *
  • Posts: 37
Mouse Screen Coordinate Token?
« on: March 07, 2025, 10:06:16 AM »
Hi Folks,

I hope everyone is doing well.

Question - can I set a token to save the x/y screen coordinates - so that when I "move mouse" I can recall the value of a previously stored token?

Thanks.

Regards,
Scott

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 309
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Mouse Screen Coordinate Token?
« Reply #1 on: March 07, 2025, 02:34:49 PM »
Sure!  There are options in the Mouse Move Action window to save the current position and to recall the mouse to that saved position - in my experience, for logic and flow, it is best to fully restrict the mouse before any of these actions, and then to be sure to unrestrict the mouse at the very end of the command.

You might even consider a "dummy" command by voice to unlock the mouse, with the only action in it to do this very thing... that way, if things go sideways as you are testing/building commands, you can easily affect a mouse unlock action without having to close VoiceAttack itself to regain control.

Example:
Code: [Select]
Fully restrict mouse movement
Save current mouse location
Move mouse cursor to screen coordinates (1507, 777)
Pause 0.075 seconds
Click left mouse button [duration 0.16 seconds]
Pause 0.075 seconds
Recall saved mouse location
Unrestrict mouse movement
Say, 'done' or 'set'

scottb613

  • Newbie
  • *
  • Posts: 37
Re: Mouse Screen Coordinate Token?
« Reply #2 on: March 07, 2025, 04:51:40 PM »
Hi...

Thanks so much.

Yeah - I've got that - what I have is an application with various buttons I need to press - So I need to have recorded the positions of all the buttons - half a dozen or so. Many commands reference these positions. I also have a desktop and laptop - so the screen coordinates vary between machines. I want to make it easy to be portable - so - I wanted to record these 6 positions - then when I move to my laptop - I only need to update these 6 positions instead of the 40 commands that call them. I thought I could save them as a tokens - screen pos 1,  screen pos 2, screen pos 3, screen pos 4, screen pos 5, screen pos 6. Then just use the token in the "Move Mouse" command.

Appreciate your time.

Regards,
Scott

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 309
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Mouse Screen Coordinate Token?
« Reply #3 on: March 07, 2025, 06:21:48 PM »
You can certainly save positions (both X and Y values) and provide them as appropriate to the Mouse Move Action, so that you can update these values in one location rather than adjusting hard coded values through many, many voice commands.

Check out the VoiceAttack Help Manual (press F1 when VA is in focus) and the Tokens section starting around page 164 for more info on these tokens and how to use them:



scottb613

  • Newbie
  • *
  • Posts: 37
Re: Mouse Screen Coordinate Token?
« Reply #4 on: March 08, 2025, 10:16:48 AM »
Hi...

Thanks so much - let me give this a shot.

Truly appreciate your help.

I say this every time I come here - - - as a 30 year "IT Guy" - - - this is by far the best $10.00 I've ever spent on software.

I've found countless uses for Voice Attack - Flight Sim - Train Sim - and even Blender modeling - and tons of other stuff.

Have a great day.
:)

Regards,
Scott