Author Topic: How prevent voice command with modifier to send double key?  (Read 1519 times)

pavsko

  • Guest
How prevent voice command with modifier to send double key?
« on: April 03, 2019, 02:13:22 PM »
Please help:
I have two voice commands: one with the modifier and one without the modifier, ie: ALT + X and X
If I activate ALT + X both commands are sent ie ALT + X AND X so both commands are executed (instead of only ALT + X).
I tried to set this: press and hold ALT -> press X --> release ALT, but this not work...
How can I prevent this unwanted behaviour?

Note: my game is IL-2 Great Battles




Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: How prevent voice command with modifier to send double key?
« Reply #1 on: April 03, 2019, 02:43:25 PM »
Are you executing a command using your voice, and the game is interpreting one key combination as both, or are you trying to execute the command using keyboard keys?

In case of the former, are you using
Code: [Select]
Press Left Alt+X keys and hold for 0,06 seconds and release
?


In case of the latter, here are two ways you can go about this:

Either you check the "Shortcut is invoked only when all keys are released" option for the "When I press keys" shortcut in both commands, which means you need to release the key before either command executes

Or, you trigger off the X key, and check inside the command whether alt is pressed when it starts(either using one command for the actions of both features, or the "Execute Another Command" action to run the relevant command).
E.G.
Code: [Select]
Begin Device State Check :  Keyboard Key 'Alt' Is Pressed
    Write [Blue] 'Alt X branch' to log
Else
    Write [Blue] 'X branch' to log
End Condition

pavsko

  • Guest
Re: How prevent voice command with modifier to send double key?
« Reply #2 on: April 03, 2019, 11:15:44 PM »
Thanx for the answer.

I am using only my voice to execute commands and yes I am using your first example (only the time is 0,100 s but I tried even much lower time like 0,01s but i does not helped).

I also tried to add "Shortcut is invoked only when all keys are released" for key presses but it does not helped (pressing ALT + X on keyboard worked well even before I checked this option, ie. no double press).

So my only problem are commands with a modifier executed by voice...

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: How prevent voice command with modifier to send double key?
« Reply #3 on: April 04, 2019, 07:34:28 AM »
Did you make sure that, 'shortcut is invoked only when all keys are released' is selected on BOTH commands?  This allows VA to determine whether or not your intent was to press one or two keys.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: How prevent voice command with modifier to send double key?
« Reply #4 on: April 04, 2019, 08:50:13 AM »
When pressing key combinations like this, VoiceAttack will first press down the modifier, then press and release the regular key, before also releasing the modifier, as you would if you were manually operating the keyboard.

Perhaps it's a timing issue; Could you try
Code: [Select]
Press down Left Alt key
Pause 0,5 seconds
Press X key and hold for 0,06 seconds and release
Pause 0,5 seconds
Release Left Alt key
The pause is extra long, for testing.


I don't have the new "IL-2" games to test with, but this could be a quirk specifically with them.

Are you aware if other people are experiencing the same issue?

pavsko

  • Guest
Re: How prevent voice command with modifier to send double key?
« Reply #5 on: April 04, 2019, 09:05:43 AM »
@Gary: yes, I selected it for both commands but unfortunately it does not help for voice activated commands

@Pfeil: well, it does not work but it is close. Finally, I tried this modification and it works:

e.g., for RSHIFT + L:

Press down Right Shift key
Pause 0,1 seconds
Press down L key
Pause 0,1 seconds
Release L key
Pause 0,1 seconds
Release Right Shift key

This command do not send double key press.