Spamming Hotkey Results in Multiple Consecutive Hotkey Presses

I've created a Macro utilizing the "W" key to activate and subsequently activate and deactivate different groups of macros. For example, pressing "W" will simulate a key press for "A", then activate the next group, and deactivate the current group. The following group which is activated utilizes the same Hotkey Press "W" to simulate an "S" Keypress, and, then activate the next group, and deactivate the current group ect. ect. It eventually loops back to the initial group, Simulating the original "A" Keypress. It must utilize the same "W" as a hotkey. The issue I've encountered is that I need one of these key presses to have a 1.8 Second pause, without accepting multiple presses of the hotkey "W" to start the macro a second time/log multiple "W" presses and continue to attempt them. The workaround I've tried is utilizing a "Semaphore Lock" at the beginning of that specific groups actions, followed by a "Semaphore Unlock" at the end, before disabling it's own group and moving onto the next one. It seems to work, however if the "W" key is pressed more than once before the 1.8 second pause is concluded, it seems to re-enable its self as multiple hotkey presses are recorded and seem to launch over and over again for as many times as it was spammed during the duration of the "Semaphore Lock". Is there a better way of doing this? How can I prevent those excess key presses from being logged/qued as attempted hotkey presses? I'd like to add that fully automating the process is not an option in this scenario, nor will "typed string" suffice.

Probably/maybe the pros understand what you mean. But it is usually better to post the macro. This helps to avoid misunderstandings. :wink:

I will definitely consider reposting with the macro I’ve created, in a more clear and concise manner. The main question I’m posing:

If my macro’s Hotkey is set to “W”, and I press “W” 10 times as fast as I can, is there a way to accept only the first press of “W” and swallow/ignore the next 1.8 seconds worth?

No, @Frankb means you should actually post your macro to the forum. Export it and just drag it to the reply box. :+1:t3:

1 Like

By default, the "Semaphore" action pauses execution of the macros that share the semaphore and are triggered after it -- they're are put into a queue, and each resumes after all those before it have finished.

If you want to "trigger but drop" those macros instead you need to set the lock's "Timeout" options (in the cogwheel dropdown) so they abort without notification after one 100th of a second. That won't get you a 1.8 second pause, but it will effectively ignore any W keypresses until the first macro has finished.

But explain what you are trying to achieve in your workflow -- it seems strange you've a loop of sequential actions, each presumably dependant on the previous, yet you're spamming the W key without regard to what's happening. Perhaps there's a better way, eg "keep doing these things until the W is released", or "pressed for the second time", or something...

1 Like