Setting Up a Macropad for Claude Code on Linux

EM Mini Pad is a compact aluminium block with five keys and a knurled knob. Linux can treat it as a separate input device, which makes it a practical size for a restrained Claude Code control set.

How does Linux detect a small macropad?

A USB or Bluetooth macropad normally appears through the same Linux input system as another keyboard. Before changing anything, identify the device and observe the codes produced by every key, knob turn and knob press. A tool such as keyd includes a monitor command for this job. Record the results rather than guessing from the legends on the caps.

The EM Mini Pad can connect by wired USB-C or Bluetooth and has a listed 1000 mAh cell. Wired mode is the easier starting point because it removes pairing and battery state from the troubleshooting path.

How do you bind the keys with keyd?

keyd is a system-wide Linux remapper built on the kernel input layer. Its configuration can target a particular keyboard identifier, which matters when the small pad sends the same codes as your main keyboard. Put only the pad identifier in the matching section, then assign one harmless key and reload the configuration.

Once that works, add navigation controls one at a time. Escape, return, tab and an interrupt shortcut cover more real terminal work than a collection of long macros. Keep one key unassigned while testing so an unexpected layer or duplicate code does not leave every switch doing something confusing.

What changes on Wayland versus X11?

A low-level remapper such as keyd works below the desktop compositor, so the basic key substitution is not tied to an X11 shortcut tool. Application-specific behaviour is a separate question and can depend on the desktop environment. Start with system-wide, device-specific keys before attempting rules that change by active application.

A bad system-wide map can affect login screens and virtual terminals. Keep a second keyboard available and read the remapper's recovery instructions before enabling a large configuration. This is another reason to make small changes.

Which five Claude Code bindings earn the keys?

Choose keys that are visible in your actual loop: escape, return, tab, interrupt and one navigation action are a defensible first map. Do not hardwire a universal approval key. Claude Code can display different prompts, and terminal focus can move without the pad knowing.

The knob is best used for reversible movement if its reported events can be mapped cleanly. The EM Mini Pad is intentionally limited. Five deliberate controls are easier to remember and audit than a deep set of hidden layers.

Back to blog