A normal keystroke involves pressing and releasing the key.
You can Press and Hold or Press and Repeat, either of which result in the key being held down and the macro continuing. The difference is with Press and Repeat, the key is held down and periodically released and repressed, just as happens if you press and hold a repeating key on the keyboard.
Either way, you can later release the key using a copy of the action with the Release option. Or once the macro completes, the key is automatically released.
Because the key stays pressed only as long as the macro continues to run.
As @ccstone pointed out, you can have the trigger repeat by adjusting the trigger to “while down” instead of “is pressed”.
If you want the Press and Repeat variant of the action to work, then that macro itself must continue to run. So to repeat the “x” key for 5 seconds, you would do:
Press and Repeat the X Keystroke
Pause 5 seconds
Optionally: Release the X Keystroke
The last action is optional because when the macro complete all keys are released.
I trust that is clear.
The reason for this is that otherwise you have keys on your keyboard effectively stuck down, which can lead to far too much confusion. Its why I have not implemented this feature at all until 7 version in.
The action is not “auto-running”. The key is being held down (and optionally repeating). That’s what the action does. It presses and does not release the key.
Then later you can release the key with the release variant.
And if the macro finishes, then it is implicitly released, essentially as a safety feature. This also works for mouse buttons, and you can image the problem you’d be in in Keyboard Maestro held the mouse button down and did not release it - your Mac becomes almost unusable. Same for modifiers like the Control key.
You can do these things, but you have to try pretty hard now.
Well, hopefully that’s some further mud to ponder.
I looked in to this, and I believe it is repeating, it is just that the system behaviour for repeating keys no longer does anything in most applications. Instead, pressing and holding a key is a sign to do other magic. (eg, press and hold “e” produces a popup to select various accented e’s).
Terminal still honours repeating keys, and the macro above works as expected in Terminal.