How to Use Second Keyboard as a Massive Macro Trigger Tool

I would like to pair my small wireless bluetooth apple keyboard and use it to launch macros, but I'm having trouble with (what I had hoped would be) a simple task.

I'd like the 'b' key to trigger a build (Xcode). But if I use the 'b' keystroke trigger .. obviously .. it runs every time I hit 'b' on my main keyboard. if I set up the trigger to be a 'usb device' trigger, it works, but it also types the 'b' character .

Any thoughts for how I can use a simple 'key' on the keyboard to trigger a macro, and not still type the key?

with something like

Interesting.. I was specifically thinking about using an Apple Bluetooth Wireless keyboard I have lying around.

Since I posted the question, I've begun looking at using Karabiner Elements to map device keys to shell script commands and using osascript to trigger the macro.

That seems to be working...

1 Like

Sounds good – though somehow virtuoso use of a musical KM keyboard (with acoustic feedback, of course) feels even more Maestronic ; - )

Oh I Know.... My son has that keyboard... and it almost made me consider taking it :smile:

But I now have the solution working very well with Karabiner Elements. My mind is blown now having a bluetooth keyboard that is just a KM macro launcher!


I use X-keys 60 for additional macro triggering. It's delightful because you can use modifier keys to expand each button to several.

Actually.. funny enough, I purchased the XK-24. I should get it tomorrow. I'm re-doing my entire keyboard setup, and trying to move down to a 'smaller' 87 Key CODE keyboard, and getting rid of my 104 key Das Keyboard. But I use the 10 key SO much for Keyboard Maestro that I thought the XK-24 should do a nice job replacing that. And.. while waiting, I started wondering how I could use a 'second' keyboard for that purpose (hence this post).

Unfortunately, the "heart" of the setup (the CODE keyboard) isn't shipping atm, so I'm going to have to wait until I get that to see it all come together.

See the FAQ: Can I use a second keyboard solely to trigger macros?

You cannot really do this with Keyboard Maestro.

Keyboard Maestro has two primary key triggers: hot keys and device keys.

Hot keys intercept and swallow the key press but cannot distinguish between the same key on different keyboards.

Device Keys can distinguish the key on different keyboards, but do not swallow the key so the key continues to perform its normal function.

So you could use all the function keys (with associated modifiers) on both Macs using a device key trigger. But you could not use, for example, the “a” key on a second keyboard without also typing an “a” (or swallowing both a's if you used a hot key).

An alternative is to use a non-keyboard keyboard, something like an XK-24 or the like, that does not perform any normal function. You can use device key triggers with that kind of keyboard.

I use a numeric keypad for this purpose.

When I was using Audacity to edit my podcast I set up Keyboard Maestro macros triggered off the keypad for certain Audacity functions.

I would repurpose my keypad if I could think of a similar use case: The technique works well.


  1. I made a paper template to remind me what the keys were set to. Not classy, rather fragile.

  2. Getting the keypad level with the keyboard and near it proved difficult.

You might be able to solve both of those problems.

The keypad came from Belkin and wasn’t expensive.

The FAQ!! Of course :man_facepalming:

I was indeed able to use Karabiner Elements to do this. Using 'complex mappings' I'm able to use keys that are specifically from that keyboard to shell script commands. Where I just send an 'osascript' command to Keyboard Maestro.

My next step is to write a Python script that can read/write that unwieldy Karabiner json file.

You wouldn't prefer to do that in JS with JSON.parse() and JSON.stringify() ?

I used to use my old Belkin Nostromo n52 as a macro keyboard. I should dig it out someday and see if it works well for this. You might be able to find one somewhere online.

You can use Karabiner to map a - z for a specific keyboard to mouse buttons you dont use. Button 3 to 28 for example.

KM recognizes these virtual mouse buttons as usb trigger device.

Works really well;)

1 Like

That is a very elegant solution and works quite well. Thank you!


Or use an iPhone or iPad and a MIDI controller like TouchOSC: