homepage

Sending multiple down-up key presses during button hold?

Posted By: DarkFib3r

Sending multiple down-up key presses during button hold? - 04/12/14 02:19 PM

I am wondering how you set up a button to send multiple endless pulses on a button press, stopping when the button is released.

For example, I want to push a button and have it send a key press, let's say the letter 'u', multiple times for as long as the button is held with, let's say, 10 milliseconds of spacing between each press. When pressing the button, I want to see u...u...u...u...u... until I let go.

Please note that simply holding the key press down will not suffice as the command I am trying to execute needs a unique key press per level of state. Furthermore, a chain may not work because I may need to send 3 presses or 5 presses, or 12 presses, depending on how long I want to hold the button down.

I am confident that TARGET can do this, but I have not yet figured out how. Any help is appreciated!
Posted By: DarkFib3r

Re: Sending multiple down-up key presses during button hold? - 04/17/14 03:49 PM

I received a reply on this post in the BMS forums and wanted to share it here to close off this loop:

Quote:
...I wanted to map my field of view zoom to my hat switch in BMS and the following works like a charm:

MapKey(&Joystick,H1U,REXEC(56, 50, "ActKey(KEYON+PULSE+L_CTL+L_SHIFT+L_ALT+USB[86]);"));
MapKey(&Joystick,H1D,REXEC(57, 50, "ActKey(KEYON+PULSE+L_CTL+L_SHIFT+L_ALT+USB[87]);"));


I hope this helps someone else wanting to do something similar.
© 2024 SimHQ Forums