Thank you @noisneil I put my palette in your macro, but unfortunately it doesn't appear. And you are right, space always repeats itself, hmm. Is there no way to type space only once? ... I could try to disable key repeat in macos.
Ah, how do I post a macro?
I'll delete that then. The important thing is that "space" is typed when the key is pressed, not when it is released. You know the reason for this
System Preferences/Settings -> Keyboard, "Key repeat rate" will be set to "Off". Or if you mean "what does turning it off change" -- holding down a key will no longer repeat. That's not such a thing these days, now that holding down eg the E key brings up the "accented characters" box rather than typing eeeeeeeee, but it'll really depend on your personal settings.
Rather than type it then delete it, just move the "Type a Space" from the top into the "otherwise" section of the "If" action -- then it will only be typed when the palette doesn't appear:
KM macros are triggered by events -- in this case, the "key down" event for the Delete key. The event is fired once, when the thing happens, so when you press the Delete key down the macro triggers -- it doesn't keep triggering if you hold the key down.
What a load of nonsense I talk! As @Frankb has pointed out, that would be true for the "key pressed" trigger, but "key down" should trigger the macro repeatedly.
But the Conditional checks the state of the key -- "is the Delete key down?" -- and the "While" repeats for as long as the condition is true, sending the simulated Delete once every loop.
So while the wording in your screenshots is similar, the way they are read is different -- "when the Delete key goes from up to down" versus "while the Delete key is down".
The other way to keep the two straight in your head is that events are things that KM is told about -- "The Delete key has been pressed down" -- while states are things that KM asks about -- "Is the Delete key still pressed down?".
I'm sure it's just me not understanding why the macro below works. It works even if in macos the repeat function is disabled. So if I press and hold "j" the cursor moves continuously to the left. On the other hand, if I change the trigger from "is down" to "is pressed", then the cursor moves only once.
With my limited logical capabilities, I assumed one could generalize this behavior.