Long Press USB Device Key - Working Example

Background: Since ControllerMate isn't compatible with Catalina, I needed to bring its functionality into Keyboard Maestro. The only thing I was having trouble with was long presses with keys on an X-Keys USB keyboard. The current examples out there seem to only work with qwerty keyboards. Here's my solution. Hope it helps.

Create a macro that requires short and long press actions with the same key. Add an Is Pressed trigger to the USB device key (or regular keyboard key combo). Also add an Is Released trigger for the same key. Add the Long Press macro and an If Condition to see if the LongPress variable is yes or no.

If the key is pressed and released within 0.5 seconds, the short press actions are played. There's also a benefit of no delay. If the key is released after 0.5 seconds, the long press actions are played immediately upon release. The example uses Control + Option + Command + L, because I wanted the example to work out of the box. Change the triggers to your USB device key as needed.


Here's the macro that needs to be included in the above example:

Download:
Long Press Macros.kmmacros (6.8 KB)