Author Topic: Why do some commands repeat shortcuts?  (Read 1439 times)

Mamy la Puce

  • Newbie
  • *
  • Posts: 19
Why do some commands repeat shortcuts?
« on: June 01, 2021, 05:58:45 AM »
All in title, i have some commands which repeat the associated keyboard shortcut and others do not.

4 orders are affected :

Croisière manuelle : voice orders or "Left Shift + 1" (cruise mode on/off)
Scanner manuel : voice orders or "Left Shift + 2" (scan mode on/off)
Portée manuelle : voice orders or "Left Shift + 3" (long range scan mode on/off)
MATS manuel : voice orders or "Left Shift + 4" (SETA mode on/off)

For each of them, I can either use voice orders, or use the keyboard shortcut associated with them and there is for each the following line in the sequence :

...
'Press Left Shift + "x" keys and hold for 0.15 seconds and release'
...

Just like all my other commands that can be used either in voice orders or with a keyboard shortcut but only these 4 commands repeat 2x the shortcut when I use their keyboard shortcut (not with voice orders), while all the others do not have this problem...

I can’t see where I’m wrong, i tried all sort of settings in the command shortcut, i tried to add a pause... etc. Nothing works properly, I don’t understand, especially since the other commands work perfectly well when I use their shortcut without having to correct anything...

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: Why do some commands repeat shortcuts?
« Reply #1 on: June 01, 2021, 06:02:52 AM »
What do you mean by "repeat the associated keyboard shortcut"? As in, it registers twice in the target application?

Do these commands have the "Do not allow key to be passed through" option enabled?

Mamy la Puce

  • Newbie
  • *
  • Posts: 19
Re: Why do some commands repeat shortcuts?
« Reply #2 on: June 01, 2021, 06:08:59 AM »
Example with Cruise mode, let us assume that it is not activated and that I wish to activate it :

- if i say "Engage la croisière" : it works like a charm, cruse mode is "On"
- if i use "Left Shift + 1" : it repeat 2x "Left Shift + 1" so it activates and deactivates it instantaneously, so it's stay "Off"

I tried "Do not allow key to be passed through" but nothing changes... (i could do some test but later because i'm not on my desk for now)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: Why do some commands repeat shortcuts?
« Reply #3 on: June 01, 2021, 06:17:04 AM »
That option should prevent the keypress from going though. You could check whether it doesn't by temporarily disabling the keypress action in your command (the one that sends the same Left Shift + X sequence), and checking whether the physical keys register ingame when you trigger the command.


If the keypress still registers, and you have no other commands that trigger off the same key combination that could cause this issue by conflicting, a workaround would be to only have VoiceAttack send the keypress if you don't trigger the command using a keyboard shortcut.

E.G.
Code: [Select]
Begin Text Compare : [{CMDACTION}] Does Not Equal 'Keyboard'
    Press Left Shift+1 keys and hold for 0.15 seconds and release
End Condition

Mamy la Puce

  • Newbie
  • *
  • Posts: 19
Re: Why do some commands repeat shortcuts?
« Reply #4 on: June 01, 2021, 03:35:44 PM »
Ok, If I delete the line in the sequence it indeed fixes the problem for this command, the problem is that I have other only voice commands that run this one since they are other variants and, as the line is deleted, it no longer activates the mode concerned.

I will try your proposition and see but thank you for help. My goal for commands that order the same thing is to centralise the shortcut to only one in order to avoid having too many things to change for users who would not have the same settings of controls in their game.

For example for cruise mode, i have:

Cmd 1 : Voice orders or Keyboard shortcut to activate or disable Cruse mode (Cruse mode on/off)
Cmd 2 : Voice orders only => execute Cmd 1 + oral replies (Cruse mode on/off)
Cmd 3 to 5 : Voice orders only => execute Cmd 1 only if off + oral replies (Cruse mode on only)
Cmd 6 to 8 : Voice orders only => execute Cmd 1 only if on + oral replies (Cruse mode off only)

That way, if someone have another shortcut for Cruse mode in his game, I/he just have to modify it in Cmd 1 and my entire profile is organized this way.

Code: [Select]
Begin Text Compare : [{CMDACTION}] Does Not Equal 'Keyboard'
    Press Left Shift+1 keys and hold for 0.15 seconds and release
End Condition

I presume this code is to add in place of: 'Press Left Shift + 1 keys and hold for 0.15 seconds and release' ?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: Why do some commands repeat shortcuts?
« Reply #5 on: June 01, 2021, 03:38:38 PM »
I presume this code is to add in place of: 'Press Left Shift + 1 keys and hold for 0.15 seconds and release' ?
Yes.

Mamy la Puce

  • Newbie
  • *
  • Posts: 19
Re: Why do some commands repeat shortcuts?
« Reply #6 on: June 01, 2021, 03:59:28 PM »
^^ This code fixes all others commands: they work all good with it in Cmd 1, but now Cmd 1 does not work perfectly   ::)

The command must play a specific sound that is no longer played, moreover, the variables supposed to be modified are no longer. I try it on Cruse mode and Long Range Scan mode, it’s easier to test on this mode because i have another voice command to send the "Echo" which is only available if Long Range Scan is activated, in other words, if the integer variable of this mode equals 1.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: Why do some commands repeat shortcuts?
« Reply #7 on: June 01, 2021, 04:01:58 PM »
If you added the condition around the keypress action (and no other actions), that should have no impact on whether VoiceAttack plays any sounds, or executes other actions.

Mamy la Puce

  • Newbie
  • *
  • Posts: 19
Re: Why do some commands repeat shortcuts?
« Reply #8 on: June 01, 2021, 04:12:08 PM »


Maybe an image is better

Mamy la Puce

  • Newbie
  • *
  • Posts: 19
Re: Why do some commands repeat shortcuts?
« Reply #9 on: June 01, 2021, 04:31:20 PM »
FORGET IT ! It works ^^ I needed to close and restart VA, that's all...  :D ;D

I don’t know how to thank you, it really helps me a lot, you’re a leader  ;)