Author Topic: Having troubles with toggle based on whether user has a key down/released  (Read 899 times)

Qbey

  • Newbie
  • *
  • Posts: 3
Hello,

I'm trying to set up voiceattack to do the following:

1- When I hold down 'W' on keyboard, voiceattack must press V once.
2- When I release 'W' on keyboard, voiceattack must press V once.

Seems easy enough but there is no option for the USER to press/release key as condition for the macro to run/trigger.

Im no programmer and going through the help section of the else/if and true/false things is making my head spin. O.o

Any help appreciated!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Not sure what you mean by
there is no option for the USER to press/release key as condition for the macro to run/trigger.

You can use the "When I press keys" option to trigger a command when a user presses a keyboard key. In addition, you can check the "Shortcut is invoked only when keys are released" option to trigger when a user releases a keyboard key.

Both can be used at once (in two different commands) to achieve what you're describing.


Alternatively, you could do this with a single command by running a loop that waits for the user to release the key (the command would be triggered by pressing the key):
Code: [Select]
Press V key and hold for 0,01 seconds and release
Start Loop While :  Keyboard Key 'W' Is Pressed
End Loop
Press V key and hold for 0,01 seconds and release

Qbey

  • Newbie
  • *
  • Posts: 3
That works perfectly thank you! I'll use that template for a host of other macros I need to run. :)