Controlling Which Macros Are Fired When Tapping Once, Twice, Thrice, or Four Times

Thank you @ccstone , @DanThomas ...

do you guys maybe know someone here who is using Karabiner Elements's Hyper-Key feature ??

that would be great....

I will of course reach out to the Automators Forum and MacPowerUsers .... maybe there are some guys who can help me out ..

but I will also try it by my self - finding out how that will work ...

Greetings from Germany

~ Tobias

I use Karabiner Elements and the Hyperkey mod. but if you are asking if it is possible to trigger a KM macro by pressing the hyper key alone (that's the normal caps-lock key) or just the combination of โŒƒโŒฅโ‡งโŒ˜ then I think you're out of luck.

This is where you specify the macro trigger in KM:
KM 0 2021-02-10_16-04-39

You can see there is no possibility to choose the caps-lock key from the pick list and just pressing caps-lock or the โŒƒโŒฅโ‡งโŒ˜ combination does not register with KM.

If I have misunderstood what you are trying to achieve then I apologise! Put me straight, if you will!


If you specify the trigger to be from a USB Device Key, then you can get it to recognise the Control, Option, Command keys like this:

But if you press the Hyper key all you get is "Try Again" like this:

Hello @tiffle ,

thank you for your reply .. I've Installed the Rule for the Hyper-Key which I found a long long time ago in the shared-page for Karabiner/Karabiner-Elements - don't know the site name now.... I wanted a quick solution for Shortcuts like โ‡งโŒƒโŒฅโŒ˜ + A , โ‡งโŒƒโŒฅโŒ˜ + S , โ‡งโŒƒโŒฅโŒ˜ + X or โ‡งโŒƒโŒฅโŒ˜ + Y for just triggering with one Hand (using QWERTZ-Layout).

The rule does nothing more than "Do Nothing if Capslock pressed alone and if there is another key it will change that Key to โ‡งโŒƒโŒฅโŒ˜ + the pressed Key...."

maybe there is a way to change the rule ? maybe adding an exec written in shell to run a "Helper Macro" which activates the Macro I want to run ?

Yes, I just looked at Karabiner-Elements preferences and you can change the rule.

I changed mine to the following:

and sure enough, when caps-lock is pressed on its own it generates the escape key.

To change the rule, click on the Add Rule button at the bottom of this window and select the rule you want in the following window, shown here:

This will now let you trigger this multi-tap macro by pressing the hyper key on its own.

Must go - there's a COVID-19 briefing...

Good luck!


thanks @tiffle ,

sounds great I will give it a try the next days... I'll come back if I stuck on it

Greetings from Germany

hello @tiffle ,

have found the Rules JSON Code - in my case it is yet a File with digits in it's name

the Path to the corresponding Rule:


I think I should give them real names or build a search Macro some days to find that file :joy::joy::joy::joy:

Here are the first 35 lines of this JSON Code

  "title": "Change caps_lock key (rev 4)",
  "rules": [
      "description": "Change caps_lock key to command+control+option+shift if pressed with other keys",
      "manipulators": [
          "type": "basic",
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "optional": [
          "to": [
              "key_code": "left_shift",
              "modifiers": [
          "to_if_alone": [
              "hold_down_milliseconds": 100,
              "key_code": "caps_lock"

That is the Option of the CapsLock Rule I changed it to on my MacBook Pro
What I can read here is that I can use any Key with it to get all 4 Modifiers and if I press and hold it alone for at least 0.1 seconds I'll get the regular CapsLock behaviour. - maybe will change the "hold" to something like press 3 times

but that is not the thing .... This Rule will maybe work as expected if I only use the CapsLock Key with any other Key

so to follow my Idea from Post #16 which was this:

My Idea looks like this 

     Tapped 1x ---> EveryDay Favorite 1 
     Tapped 2x ---> EveryDay Favorite 2
     Tapped 3x ---> EveryDay Favorite 3

Normal use 
     Tapped 1x ---> Once a Week 1 
     Tapped 2x ---> Once a Week 2
     Tapped 3x ---> Once a Week 3

seems only possible to me with two Binding Setups and an option to change between them like

press CapsLock twice while holding right Shift Key  (It should not be easy to switch)

* runs Macro with Global Variable and is checking for SetupName 

   * If SetupName = Setup 1 ---> activate Macros for Setup 1, deactivates Macros for 
      Setup 2, change Variable 
   * If SetupName = Setup 2 ---> activate Macros for Setup 2, deactivates Macros for 
      Setup 1, change Variable

but seems that is not the only thing - sure - I have to add this rule in both Setups

In the second Setup there should not be the Hyper-Key but at least the Press 3 times to envoke the CapsLock behaviour.
This will make it possible to have a "normal 4Modifier HotKey " and a "Hyper-Key one"

how can I set up the JSON for CapsLock with Holding any Key? is this even Possible ? - It would be great .. this will make it possible to use @JMichaelTX 's Hold A Key Template Macro the same way....

Greetings from Germany

~ Tobias

Hi @Nr.5-need_input.

I'm afraid configuring Karabiner-Elements is not something I can help you with any further - perhaps ask in their support forum?

Stay safe!

thanks for your help anyway @tiffle ,

Maybe you can't help me withconfiguring the JSON - but It wa YOU who remembered me that there were more Options than just one in the RuleSet !!

Thank you for that !!!

Since you did that Yesterday is was more than absolutely nothing :+1: :pray:

have found an article a few minutes ago called Karabiner God Mode from @nikivi who is also on this forum ... meybe he can help me with that ...

Stay safe, too

Greetings from Germany


1 Like

Hello @nikivi ,

since you've written about Karabiner / Karabiner-Elements maybe you could help me out with my Problem.

Maybe yo read this thread from the beginning to get a little bit background

it would be great if you can help me out

Thank you

Greetings from Germany


@DanThomas, @JMichaelTX, @ccstone

I can't thank you guys enough for this help. I think this macro is built into over 160 keys now.

Is there a time when you have too many macros and that slows the system down? How does it work with grabbing mouse position for example. That seems always live. So if I have a 160 actions always reading the mouse position does that slow things down eventually?

1 Like

Generally speaking, a macro has to be triggered before it does anything. So if you have 16 macros or 160 macros, or in my case over 1600 macros (and I'm sure there are people with lots more), it doesn't make much difference.

When you say that grabbing the mouse position always seems live, I suspect you're talking about when you've got the macro open in the editor. And in that case, don't worry about it.


Well that's good news. You guys have opened up a Pandora's box. I feel like Alice in Wonderland. Everyday I wake up with an idea to automate something else.

Yes, I see the mouse grabbing position when the macro is open.

I'm sure this is could be cleaned up, but here is your macro and one from @JMichaelTX combined. Thanks again you guys!


1 Like

You know what's really fun about this? You'll start to think of ways you could have done it better, and then you have to decide if it's worth it to change them. But at that point, it's better to figure out if you can combine similar logic into "sub-macros", so it only needs to be changed in one place.

In other words, you'll never be finished! :joy:Have fun.