Key Press and Key Release in one action?

I have set up KM so I can use a mouse tool in Logic as a 'momentary' tool - i.e. the mouse changes to this tool while a key is pressed, then changes back to normal when the key is released.

At the moment I have done this with two separate actions - one triggered on key press, the other triggered on key release. This works fine, but purely for neatness I was wondering if there's any way of combining this in a single macro?

1 Like

Hey there! This is definitely possible with hotkey triggers, I just built a macro the other day to simulate a press-to-mute and press-to-talk feature with my microphone monitor.

It's pretty straightforward. You place your initial actions at the top of the macro, followed by an If action that determines if the trigger keys are still down, and if they are pauses until they are released. Your subsequent actions are placed below that pause action and will execute when the keys are released.

Try out the demo macro I made and let me know if it works for you or not!

-Chris

Run macro on key press and key release.kmmacros (5.5 KB)

Brilliant - thanks! I had a feeling it would use the IF function, but I couldn't quite work out how. I'll give that a go!

1 Like

Great! Let me know if it doesn’t work of if you have any questions on it :+1:t2: