Author Topic: Hold Keys and Release Keys all in the same command?  (Read 1017 times)

Starblue7

  • Full Member
  • ***
  • Posts: 131
Hold Keys and Release Keys all in the same command?
« on: March 03, 2023, 09:55:04 PM »
Hi.  I want to do the following:
Trigger Action:  Double-Tap the Shift+W keys to invoke the command
Command:  Hold down Shift+W keys until I double-tap the Shift+W keys again, which would release them from being held down.

Is something like this possible within 1 command?

I was thinking via some LOOP, but it doesn't seem like VoiceAttack has DOUNTIL Loops.
i.e.  Do loop until some action happens (like double-tap Shift+W)

Advice appreciated!

Thanks!

Starblue7

  • Full Member
  • ***
  • Posts: 131
Re: Hold Keys and Release Keys all in the same command?
« Reply #1 on: March 03, 2023, 10:39:44 PM »
Thanks,  I've tried this, but it yields odd behavior:

TRIGGER:
Double-Tap Shift+W

Command:
Begin Condition : ([{STATE_KEYSTATE:SHIFT}] Equals '1' AND [{STATE_KEYSTATE:W}] Equals '1')
    Release Left Shift+W keys
Else
    Press down Left Shift+W keys
End Condition

The behavior:
Double-Tap initiates the command correctly and presses down the SHIFT+W keys.
Double-Tapping again does not activate and RELEASE the above keys like in the Conditional statement above.
I can now only break out of this behavior by hitting SHIFT+W once.  (So it's like Double-Tapping doesn't matter or something)


Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: Hold Keys and Release Keys all in the same command?
« Reply #2 on: March 03, 2023, 10:43:06 PM »
Pfeil had reminded me that we're checking the state of the same keys that are being used - which will interfere. I removed the post - sorry about that. 

Have you tried maybe a different combo to invoke the command?  Anything other than Shift or W in this case -   

For instance - double tap F7 checks the state of Shift and W - presses or releases depending on state.

Starblue7

  • Full Member
  • ***
  • Posts: 131
Re: Hold Keys and Release Keys all in the same command?
« Reply #3 on: March 03, 2023, 11:17:44 PM »
It's not a big deal at this point.
Pressing SHIFT+W still will exit the above condition.

I'll stick with that I guess..

Thanks  ;)