Inconsistent results with USB device key long press as trigger

Hello!

I'm seeking advice on how to improve my macro to display a "text formatting macro group" palette when "This USB device key OpticalMouse #64* is long pressed.

  1. The palette has intermittently displayed even though I have not long-pressed the mouse button.
  2. The palette has intermittently not displayed even though I have long-pressed the mouse button and the "Copy" menu item is available.
  3. The palette does not display under the mouse cursor, even though the palette's "Place palette under mouse" checkbox is checked. If I use the palette's keyboard shortcut (command escape) instead of long-pressing, the palette displays under the mouse (cursor).

Hope the above makes sense.

Thanks in advance!

I have resolved items 1 and 3 above, but long-pressing the left button on my Satechi USB-C mouse does not consistently display the associated palette (the assigned keystroke does).

Does this indicate that my mouse and KM are not compatible?

Maybe.

It may be that the mouse button is not being kept down as far as Keyboard Maestro is concerned. It may be the mouse is sending other events. It might be that there are some modifiers doing things, maybe the mouse is sending some modifiers for some reason.

Verify whether the macro is triggering or not (in the Engine.log file).

Try creating two macros, with the USB Device Key trigger on the mouse button, and configure one to pressed and one to released and see what you get in the log if you press and hold the button.

Hi Peter,

Many thanks for your helpful posting.

Yes, the Engine log file includes multiple records like this one.

2025-07-07 14:01:09 Execute macro “Show Text Fomatting Palette if "Copy" menu item available” from trigger The OpticalMouse #64 key is long pressed

Here’s the Engine log entry for pressing and holding with the macro configured for pressed.

2025-07-10 09:06:33 Execute macro “Show Text Fomatting Palette if "Copy" menu item available” from trigger The OpticalMouse #64 key is pressed

Here’s the Engine log entry for pressing and holding with the macro configured for released.

2025-07-10 09:08:38 Execute macro “Show Text Fomatting Palette if "Copy" menu item available” from trigger The OpticalMouse #64 key is released

In both of these tests, the log contains multiples of the above entries, even though I pressed and held the mouse button only once.

What do you infer from these results?

Barry

That despite the button being held, the mouse is sending repeating press release events. Maybe by design, maybe unintentionally.

Hi Peter,
Many thanks for your helpful reply.

OK, I will use some other trigger than USB Device Key long press.