Holding a Modifier via 'If Then Else' Action for Multiple Key Presses?

I'm trying to make a macro where if I hold a modifier (command) and press a MIDI message, it will execute an action.

MIDI Trigger, note 91 is pressed

If all of the following are true: these modifiers are pressed (command)
execute the following actions: type the keystroke (-)

This works fine only if I'm doing exactly one "command + MIDI note 91" a time. If I try to hold the command key and tap MIDI note 91 multiple times, it doesn't register any subsequent presses after the first.

Is there another way to accomplish this maybe? Thanks :slight_smile:

Is the macro being triggered each time?

Check the Engine.log file, add a Log action to the macro, or use the Macro Debugger.

If the macro is being triggered, but the following instances are not seeing the Command key, that is likely because you are simulating the ā€œ-ā€ keystroke, which requires Keyboard Maestro to release the Command key in order to simulate the - keystroke without a command key.

Thanks for the reply.

Yup, it looks like it is being triggered each time. I'm not sure how to use this new info to make this macro work though. Maybe there is another way to go about accomplishing this?

Probably not as it is, you can't detect the Command key as being down when it has effectively been released in order to simulate typing the non-command key.

gotcha. It's kinda wild how this works with non modifier keys, just using a 'key condition'. "If the key 'G' is down, simulate keystroke -", but it can't work with a modifier. I guess the modifier must be 'released' in order to simulate the non-command key, but a regular non-modifier key doesn't need to be? Unfortunate. Thanks for the help.

It would not work with the ā€œGā€ key if you included an action that typed a G (including say an Insert Text by Typing action with text containing a ā€œGā€).

ah i see, makes sense. Well for now using non-modifiers will have to do. Thanks for the help Peter.

1 Like