Triggering a macro multiple times with a modifier held down

I have a macro that I trigger using a stream deck, and I trigger it with the KM action, and I want to use it with the command key pressed.

Screenshot 2024-07-05 at 11.45.23

It works.
But when I keep pressing the command key, and run the macro again, KM does not trigger this macro. Only when I release it, and press it again, it works.

The same behaviour happens with the ctrl key.

The same behaviour happens when I insert an ifthenelse with the condition Command Modifier Down.

When I use a key on my keyboard together with the command modifier instead of the stream deck it works as expected.

How can I solve this?
Or is this something our beloved Guru should do?

My Stream Deck Mobile (which is a Stream Deck emulator for iPad) does not work that way. It triggered every time, even without releasing the modifier. So my conditions aren't the same as yours, but I'm not getting your problem.

Did you turn on your debugger and click on "Pause New Macros" (or check the log) to confirm if the macro is triggering or not?

Thank you Airy.

No, I have not done the debugger routine . I have to admit that I still don't know how it works and never dived into it. I always found other ways to debug.

But, there is another macro triggered that is triggered by the same StreamDeck key but then without the command modifier. Let;s call that Macro1. Macro 2 is the macro that is triggered with the Command key down.
So, when I press command and press my tigger key; it launches Macro 2.
I keep holding down the modifier,
I press the trigger key; it launches Macro 1. (But I expected to launch Macro2)

So, I know that the trigger key works, but I also know that the modifier is not seen as being down as the wrong macro is launched.

I understand. You have proven that Macro1 launches. But to be honest, you haven't proven that Macro2 doesn't launch, which is what I was trying to show with my advice about the debugger. Since I can't see Macro2's code, and since I can't see your log, I can't prove to myself it's not launching. Did you check the Engine log file?

There's definitely a chance that my line of inquiry will not result in your answer, but it will help to confirm that your assumptions (that Macro2 is not triggering) are correct.

"macro1" does not trigger when command is down. So I do know.

Ok, sorry, I've done all I can do without being able to see the macros.

Thank you for thinking along!

ok. I made a test macro and now it does not happen. There must be some actions in the macro with the command key that influences this behaviour and I have to figure that out first.

Ok, I found the issue. It's a key press.
I made a test macro that has this behaviour. (almost. )

Modifier test.kmmacros (4.5 KB)

Import the attached macro.

On your StreamDeck, make a profile that is active when the Finder is at front.
Insert the Keyboard Maestro action on your streamdeck and give it a unique RCnumber if it doesn't have it already.
Edit the trigger of the imported macro so that the stream deck action triggers the macro.
Close the StreamDeck editor windows.

Switch to Finder. (The macro will press the "=" key so make sure it doesn't mess around with something that you don't want. )

• Launch the macro without the Command modifier.
• There will be a notification that say "Command Modifier is Up"
• Press the command modifier and launch the macro.
• There will be a notification that say "Command Modifier is Down"
• Release the modifier key
• Press the command modifier and launch the macro.
• There will be a notification that say "Command Modifier is Up" THIS IS WRONG! It is down!
Whatever state the command key is in now, it will all the time tell you it is up. Only when you switch to another program and come back to the finder it resets.

It looks like the Key Press Action, if it has no Command Key in it as action, resets the status of the command key in KeyBoard Maestro. You can see this by observing the "currently false" or "currently true" status of the condition in the If then Else.