Simply macro to loop a key press

Hi all,
I am new to this app and I am convinced it will do what I need.
For gaming purposes I want to hold down the key 1 and whilst held down simulate a key 1 press every second until the point where I release the key 1.

I have create a macro that I feel should do this however every time I press the 1 key it DOES start the macro fine never stops, if I press 1 again then it spawns up a new and 2 macro and so on and so on, how can I get it to spin up only one edition of my macro and to stop when I release my key?

Any suggestions for a noob ?

Hi Lee,

How is your macro set up? This one I just put together to simulate your use case seems to work for me:

Type 1 Every Second.kmmacros (2.3 KB)

Hiya and thanks for coming back so quickly, I actually didnt think I would get a reply.
Below is my macro, its basically the same as mine however the issue I am getting is that if I release key 1 and then1 repress 1 it spins up another engine so now its double tapping the 1 key on and on.
It also never stops when I release the 1 key.

No problem! Luckily for you, your problem is actually easily solved once you know what to look for. While our macros are very similar, there is one crucial difference that explains the behavior you’re seeing. If you look at the final step of your macro, the “until” part, you’ll see that the loop is currently set to continue until the “1” key is down, when it should be until the “1” key is up. As it’s set up now, the macro will continue to execute until the “1” key is manually pressed (which explains why it doesn’t stop when the key is released currently). But of course, pressing it in turn triggers the macro again, which explains why another instance of the macro spins up and starts double tapping “1”. Hopefully that makes sense!

To sum up: just change the “until” condition to “up” instead of “down” and I believe it should work as expected. Good luck, and don’t be afraid to ask more questions here in the future! There are a few active members here, including KM’s developer himself, who are pretty good about responding to almost any question KM users may have.

Hi all,

I am trying to revisit this macro, I see the application has upgraded recently and now this macro doesn't work.

Does anybody know how to simply loop a key press, in this case 1, whilst its held down and stop upon release?

Thanks for any help.  :stuck_out_tongue:

This macro works in my testing. The Semaphore Lock (set to timeout immediately and not report anything) avoids the macro running multiple times. The “is pressed” trigger triggers the macro just on the first press, and the until loop keeps repeating the 1 as long as it is pressed (note: as long is the “1” key is down at the end of the second it is considered still pressed, so if you release and repress it, that is considered still pressed).

One.kmmacros (2.7 KB)