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?
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.
Oh I Know.... My son has that keyboard... and it almost made me consider taking it
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!
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.
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 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.
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.