macro-keyboard

Configure cheap 3-key USB-C/Bluetooth macro pads on macOS with Karabiner-Elements. Covers Fn emission, device-scoped remaps, HID diagnostics, dual-transport (USB + Bluetooth) rules for pads whose BT firmware emits different keycodes than USB, and two tap-vs-double-tap techniques: Karabiner-side software discrimination (set_variable + to_delayed_action, when the pad emits the same keycode for every press) and pad-firmware-decided keycode translation (when the pad's firmware itself decides single-vs-double-tap and emits two different keycodes — discovered on the worked-example Free3-P bottom button over Bluetooth, 2026-05-02).
[!NOTE]
This plugin was distilled from live work on a Jieli/Free3-P 3-key pad (VID 0x4c4a USB / 0x04E8 BT). The patterns apply to any cheap HID pad from AliExpress or Amazon — Jieli, Realtek, CH57x — that cannot be flashed with QMK/VIA/Vial.
[!TIP]
Want the turnkey recipe? → skills/configure-macro-keyboard/references/09-turnkey-walkthrough.md — copy-paste-ready 30-minute walkthrough for a ~$10 pad with tap-vs-double-tap on all three buttons: top (Fn for Typeless toggle / Cmd+V paste), middle (Shift+Return / Return), bottom (up arrow / down arrow), across USB + Bluetooth. Heads-up: the bottom button uses two different mechanisms — software discrimination on USB (Karabiner-side), firmware-decided-keycode translation on BT (the pad's BT firmware emits equal_sign for single tap, Option+Z for double tap).
What You Get
| Skill | Purpose |
|---|
configure-macro-keyboard | End-to-end workflow: identify the device, write a Karabiner rule, scope it to that device, handle USB + BT |
emit-fn-key-on-macos | Emit real Fn (for Typeless push-to-talk, macOS dictation, etc.) — the one thing BTT / hidutil cannot do |
diagnose-hid-keycodes | Find out what a mystery button emits using Karabiner's ignore: true diagnostic + EventViewer + Quartz |
diagnose-dead-global-hotkey | Find why a global hotkey dies while one app (VNC/remote-desktop viewer, VM, game) is frontmost: per-app remap rewrite, keyboard-grab tap, Secure Input; fix the failing layer |
Installation
Option 1: Plugin Marketplace (Recommended)
/plugin marketplace add terrylica/cc-skills
/plugin install cc-skills@macro-keyboard
Option 2: Settings Configuration
Add to ~/.claude/settings.json:
{
"extraKnownMarketplaces": {
"cc-skills": {
"source": { "source": "github", "repo": "terrylica/cc-skills" }
}
}
}
Option 3: Manual
git clone [email protected]:terrylica/cc-skills.git /tmp/cc-skills
cp -r /tmp/cc-skills/plugins/macro-keyboard/skills/* ~/.claude/skills/
Prerequisites
| Tool | Install | Why |
|---|
| Karabiner-Elements | brew install --cask karabiner-elements | Required. Only userland path to real Fn on macOS (via DriverKit VirtualHIDDevice). |
| blueutil | brew install blueutil | Optional. BT force-connect + info queries during pairing. |
macOS permissions: Karabiner needs Input Monitoring, Accessibility, and (on Sequoia+) a Login Items toggle for its privileged daemon — the skill will remind you.
Quick Example: Jieli/Free3-P (MacroKeyBot)
After pairing + USB plug-in:
# 1. Identify the device
ioreg -p IOUSB -l -w 0 | grep -A 20 "USB Composite Device"
# → VID 0x4c4a, PID 0x4155 (USB)
# → BT: pair via System Settings; signature 0x04E8 / 0x7021 / "Free3-P"