How do you configure the long press time?

Then he should use your macro. My macro does trigger on the two conditions he wanted, but it also triggers on two other conditions, which are not what he wanted. If I can get my macro debugged, I will post it for comparison purposes.

I ended up continuing to use your macro for the long press, because I wanted to maintain the ability have it trigger after a set time instead of waiting until I lifted my finger. The native can't do that, unfortunately, so that continues to be an advantage that your macro has.

Also, I was never having timing issues between the long press on your macro and my macros that I was triggering with your long press. It was the short press on your macro that I was having timing issues with, when trying to use the short press on your macro to trigger some macros. I never did quite figure out what the issue was.

In any case, my solution was to use your macro for triggering other macros in a long press scenario and to use the KM native short press for triggering other macros in a short press scenario. Best of both worlds.

Just checking... Are you using the new submacro version or the old one that had all the press detection in a template?

No, the trigger happens on release and either tap or long press is triggered.

Peter is always right, but he meant within the built-in features of Keyboard Maestro. With a little programming, almost anything is possible with Keyboard Maestro. I've just written a macro that seems to work. During my initial tests, this does exactly what you are asking for. If not, let me know.

It is able to detect if the button is pressed and held for one second (you can change that value, of course. For my testing purposes one second was a good test value.) If the button is released in less than one second, the macro speaks the word "Released" (and you can change that action, of course.) If the button is held for longer than one second, the macro speaks the word "Held down" (and you can change that too, of course.) From what you've told me, you want the same thing to occur in each case, so you can either create a macro that is called by this macro in those two places, or you can just duplicate your code in the two places in this macro.

You will also have to adjust the trigger to insert your own mouse button in there, as I have a different brand of mouse than you have.

Let me know if you have any problems with it. I tested it for five minutes, but that's no guarantee it will work for anyone else.

If Held for 1 second, do one thing, if released first, do a different thing Macro (v11.0.3)

If Held for 1 second- do one thing- if released first- do a different thing.kmmacros (11 KB)

1 Like

I believe I'm using the one seen below:


You should try the new version.

The press detection is now done in the background via a submacro, which means that you only need to add one action (a submacro caller) to any macro that would benefit from multiple press types. It's so much neater than the old version, which you're using.

1 Like

I didn't know you had a new version. I must have grabbed that older version right before you updated this thread with the new version.

Is it faster or more reliable or something? I'm not opposed to trying the new one, but if it doesn't offer a performance boost or something, I may not bother. It's not like your older macro doesn't work for what I need.

It's just much easier to set up and use. Have a look at it and see for yourself; you can always delete it.