Multiple Tap Hotkey Triggers - Only or Not?

Keyboard Maestro 11 introduced multiple tap only hotkey triggers. So we now have a trigger for "is tapped 3 times" and "is tapped only 3 times". What is the difference between the "only" and "not only" triggers?

I hope you don't mind if I defer you to the documentation. Read the "When" section of this page...

https://wiki.keyboardmaestro.com/trigger/Hot_Key

If you find something in there that you don't understand, let me know, and I can clarify it.

4 Likes

I hadn't tried the "only" trigger and the manual page (as linked to by @Airy) didn't seem to tell me, so I made a test macro and found that (using your examples):

  • "Is tapped 3 times" will trigger a given action if the key is tapped 3 or more times.
  • "Is tapped only 3 times" will trigger the action if the key is tapped exactly 3 times – no more, no less.

I don't think the current naming of those options makes the choice obvious, but the names are at least concise, and renaming things is a can of worms I had better not try to open. :slight_smile: Finding the answer in the Wiki could be improved though (unless I overlooked something obvious). @peternlewis

This would also trigger any macro that is set to 'is tapped once' or is set to 'is tapped twice'.

Whereas 'is tapped only 3 times' would only trigger that single macro, it would not trigger
'is tapped only once', 'is tapped only twice', 'is tapped once' or 'is tapped twice'

I did read that documentation, but did not fully understand it. But troy and kevinb's example did help clarify the "not only" triggers. I do appreciate your response.

1 Like

Thank you. Your example did clear things up for me.

Excellent explanation. I see a use case for the "only" trigger. What use case would there be for the tapped 3 times trigger if it triggers macros that are set to tapped once, tapped twice, and tapped 3 or more times?

The use case could be needing faster response times. There is less delay after the third click.

This does not make sense (and to the degree that it does, is not true).

A macro that is triggered is tapped only 3 times will trigger when you tap the key three times and then stop pressing it for a period of time.

But it's existence or not will in no way affect a macro that is set to trigger by is tapped only once (which would not trigger if you tapped three times because you did not stop pressing the key after the first tap) nor whether a macro that is set to trigger by is tapped once (which would trigger in this case, after the first tap).

The existence of such triggers do not affect whether other triggers trigger.

1 Like

is tapped three times will trigger if you tap the key three times in quick succession. It will trigger immediately as you tap it the third time. What you do after that will not affect whether the macro triggers.

is tapped only 3 times will trigger after you tap the key three times in quick succession and then do not tap it any further for some period of time. Thus it will not trigger until some period of time after the third tap while Keyboard Maestro waits to see whether you are going to press the key again.

Which you use depends on what behaviour you desire.

For example, say you want to quit the front application with one tap, and quit all applications with a second tap. In that case, the first macro could be triggered by is tapped once and the second by is tapped twice. Since it makes no difference if both macros run when you tap it twice, there is no need for t a delay after the first tap before quitting the application.

But imagine if you wanted the reverse, quit all applications if you tap once, but only the front application if you tap twice. Then you need to use is tapped only once, even though there will now be a delay, because otherwise all applications would be quit in both cases.

So the only option comes with an unavoidable delay, but allows for alternative behaviour that isn't possible without the delay.

Thanx @peternlewis , I was not thinking.

Of course the tapped once, tapped twice and tapped 3 times macros would trigger when the trigger is tapped three times.

Apologies to @rstockfleth for the bad info!

1 Like

The delay can be adjusted:

defaults write com.stairways.keyboardmaestro.engine MaxTapDownTime -float 0.2
defaults write com.stairways.keyboardmaestro.engine MaxTapUpTime -float 0.2

This works nicely for me.

3 Likes

Yes, I've shortened that a bit.

Just sharing that I use modifier keys for this 'multi press only' approach and then will put a small (.2) delay, or a 'pause until modifier key is pressed', as the first action in the macro and then use an 'if' statement' action to be able to branch off to trigger following actions.

Using this method I don't have to move my hands to trigger a large amount of macros.

I don't post a lot, but I've uploaded a basic example, maybe this is helpful to someone.

z Mod Multi Left ⌘ Command x 3 display.kmmacros (23 KB)

Very helpful explanation, Peter. I actually have thought of use cases for 'only' and 'not only' triggers. Great forum! Thanks everyone.

1 Like