Author Topic: Using Keyboard shortcuts  (Read 3113 times)

sunnyod

  • Newbie
  • *
  • Posts: 13
Using Keyboard shortcuts
« on: April 04, 2021, 09:37:57 AM »
Hi,

I'm trying to use keyboard shortcuts to run advanced macros but for some reason the keyboard shortcut 'ctrl+]' doesn't do anything. I can use voice or right click and 'execute' to run the command though, so it works. I've got keyboard 'Keyboard Shortcuts' set to enabled. The log doesn't show that the keyboard shortcut is being recognised. Is there something I may be missing?

Thanks
Sunny

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Using Keyboard shortcuts
« Reply #1 on: April 04, 2021, 10:53:01 AM »
Okay so I've gottten a little further. I can still right click and execute to run the full sequence perfectly, but if I run the keyboard shortcut it seems to attempt to do the programmed sequence but it's off the mark as if it needs more delays between actions. Not sure why right click execute would work more efficiently than a keyboard shortcut. Maybe there's a setting i'm missing?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2831
Re: Using Keyboard shortcuts
« Reply #2 on: April 04, 2021, 12:28:51 PM »
Hi, Sunny

Although triggered in different ways (by voice, keyboard, mouse, command line, etc.), the execution of all of VA's commands go through the same code.  More information is going to be needed in order to figure out what you've got going on.

What does your command look like?  Can you share a screenshot of the command edit screen with all of its actions?

Also, have you tried triggering the command with a different key combination?

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Using Keyboard shortcuts
« Reply #3 on: April 04, 2021, 02:22:02 PM »
Hi Gary,

Thanks for getting back so quick

The command I’m trying to run is moving the mouse cursor around and performing actions on 2 different apps. See attached

I’ve tried different shortcuts and looks like that’s having an impact. I was failing with alt+shift+up arrow, but tried ctrl+[ and that worked better. It’s still not as stable as running right click execute though from memory. Will test some more when back at pc

Cheers
S


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4776
  • RTFM
Re: Using Keyboard shortcuts
« Reply #4 on: April 04, 2021, 02:32:10 PM »
Have you tried enabling the "Shortcut is invoked only when all keys are released" option, to make sure none of the shortcut keys are still pressed while the actions in the command are executing?

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Using Keyboard shortcuts
« Reply #5 on: April 04, 2021, 04:26:03 PM »
Hi Pfeil,

No I'd not tried that - it seems to be working a little better now. Will do a bit more testing .... Thank you!

Btw. Wanting to set a number variable using a command and then paste the value of that variable to a text field in an app when executing another command. I guess I need to use "Set Integer" or "Set Text value" to set it? Then how do I paste the variable into the text field in the app?

Thanks
Sunny

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4776
  • RTFM
Re: Using Keyboard shortcuts
« Reply #6 on: April 04, 2021, 04:40:24 PM »
You'd use the token appropriate to the datatype of the variable you set, E.G. "{INT:}" or "{TXT:}", with the "Set a Text Value to the Windows Clipboard" action, combined with a keypress action that presses Ctrl-V (or Shift-Insert, if you prefer).

Targeting a specific field on a window is problematic, however.
You'd need to either move to mouse cursor to the field and click in it (which then relies on the window either being in the exact same location every time, or setting up the coordinates to be relative to the window rather than the screen), or target the window and use the Tab key to cycle through the controls within that window until you get to the correct one (which would rely on the control that initially has focus being the same each time, assuming you're closing the window after pasting)



These topics may be of use in addition to the official documentation (press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer):
Control flow (If, Else, ElseIf, Loop, Jump) basics
Variables and tokens summed up

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Using Keyboard shortcuts
« Reply #7 on: April 05, 2021, 04:47:33 AM »
Thanks for the info Pfeil. I got the variable working nicely now

Regarding the hit and miss keyboard shortcuts, I added the "Shortcut is invoked only when all keys are released" option to all the commands but it still works about 50% of the time, compared to when I use right click 'execute it works pretty much 100%.

I've tried amending the commands to include more time but it's not helped. I've attached an example of what i'm doing. FYI. The "Set Text" is just 3 characters long

FYI. I've put these commands under a Global Profile so they can be triggered from any app. Not sure if that make a difference. Also my pc is pretty high spec and is not under a lot of load, if that helps rule things out
« Last Edit: April 05, 2021, 06:22:04 AM by sunnyod »

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Using Keyboard shortcuts
« Reply #8 on: April 05, 2021, 09:20:08 AM »
Hi Guys,

I've realised that sometimes this works great and other times it doesn't with Shortcut keys. I tried to eliminate one thing at a time and I realised that one of the apps VA is interacting with is maxing out the GPU. It normally runs between 80-99%. When I stopped the app process creating the GPU load, the responsiveness and accuracy of VA went up and it's working as expected.

I managed to work out why GPU load is so high and have fixed it. Will monitor, hopefully should be sorted...

UPDATE. No still same issue! :)

Thanks
Sunny

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4776
  • RTFM
Re: Using Keyboard shortcuts
« Reply #9 on: April 05, 2021, 12:42:25 PM »
Do you have the "Do not allow key to be passed through" option enabled?

Have you tried adding a slight pause at the top of the command? E.G. 100ms

Have you tried increasing the pauses in your command(s) in general?

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Using Keyboard shortcuts
« Reply #10 on: April 05, 2021, 02:34:58 PM »
Hi Pfeil,

I just confirmed all commands are using "Do not allow key to be passed through" option. Also I've tried adding pauses at top of commands and up to 0.5s in between each command, but no luck as yet

Thanks
S

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4776
  • RTFM
Re: Using Keyboard shortcuts
« Reply #11 on: April 05, 2021, 02:41:48 PM »
Did you also increase the hold-down times for the keypress actions?

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Using Keyboard shortcuts
« Reply #12 on: April 06, 2021, 04:06:43 AM »
yeah tried that too, set all times to 100ms

btw Im automating this sequence across 2 apps. The issue seems to be happening on the app that's not in focus. Do you think focus could be the issue? Doesn't explain why it works sometimes though

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Using Keyboard shortcuts
« Reply #13 on: April 06, 2021, 07:53:21 AM »
Not to worry guys, thanks for your help. I found a different solution