WikiKeyboard

When you buy through our links, we may earn a commission. About our links ›

Keyboard Macros and Programming: How to Customize Keys

Short answer: Keyboard macros let you assign custom actions to keys, from simple remaps to multi-step command sequences. The best keyboards for programming run open-source firmware like QMK or VIA, which store profiles on the device and work across systems. When shopping, look for full per-key remapping, macro recording, multiple layers, and on-device memory. These features let you build a keyboard that matches your workflow without depending on vendor software.

What are keyboard macros?

A keyboard macro is a sequence of keystrokes or commands triggered by a single key press. The word "macro" comes from programming, where a macro expands a short name into a longer set of instructions. On a keyboard, you can record a macro that types your email address, runs a series of shortcuts, or even launches an application.

The USB HID specification is the foundation for how keyboards communicate key presses to your computer. The HID Usage Tables define the numeric identifiers for each physical key, so a keyboard can send a standardized code for the letter A, the Enter key, or a media key. When you remap a key, you change which HID code that physical key sends, without changing the hardware.

Macros go beyond a single key swap. They can send multiple key codes in a timed sequence, include pauses, or simulate mouse actions when the keyboard supports it. Some keyboards store macros on the device itself, so they work on any computer, while others rely on software running in the background.

  • Remapping: change a key to send a different single key code.
  • Macro: trigger multiple actions from one key press.
  • Layer: switch to an alternate set of key assignments, often via a Fn key.
  • On-device memory: macros and remaps are stored in the keyboard's firmware.

How key remapping works

Every keyboard uses a matrix of switches and a controller chip to detect which key is pressed. The controller sends a HID report to the computer, which the operating system interprets based on the current keyboard layout. Remapping changes the mapping between the physical switch position and the HID code it sends.

You can remap keys in several ways: vendor software, open-source firmware, or operating system utilities. The method you choose affects portability and flexibility. For example, a macro recorded in vendor software may only work while that software is running, whereas a remap stored on the keyboard's memory works everywhere.

Windows itself includes many built-in shortcuts, as documented by Microsoft. For instance, Ctrl+C copies, Ctrl+V pastes, and Ctrl+Z undoes. Remapping a key to produce one of these shortcuts can save you from reaching for the Ctrl key or help if a key is broken. You can also create custom shortcuts to launch apps or switch desktops, but the keyboard firmware gives you the most control.

What to look for in keyboard software

When choosing a keyboard for programming, the software is as important as the switches. Look for these capabilities: full per-key remapping, macro recording, multiple layers, and on-device storage. Per-key remapping lets you assign any action to any physical key, including Fn and modifier keys.

Macro recording can be done in two ways: on-the-fly using the keyboard's built-in memory, or through a desktop application. On-the-fly recording is convenient for quick, temporary macros, but desktop software often allows more complex sequences and precise timing.

Layers are essential for compact keyboards. A layer is a separate set of key assignments that activates while you hold a designated key. This is how a 60% keyboard can include arrow keys, function keys, and media controls without extra physical keys. The best implementations let you assign any key as a momentary layer shift, which you can configure in the firmware.

Open-source firmware like QMK and VIA has become the gold standard for keyboard programmability. QMK is a firmware that runs on many keyboards and offers deep customization through C-like configuration. VIA is a graphical interface that communicates with QMK devices in real time, so you can remap keys and adjust lighting without flashing firmware. If you want this level of control, check that the keyboard supports QMK or VIA. See our QMK and VIA firmware guide for details.

Feature comparison for keyboard programming
FeatureWhy it matters
Per-key remappingAssign any function to any physical key.
Macro recordingRecord and play back multi-step sequences.
Multiple layersExpand the number of actions per key.
On-device memoryYour settings work on any computer.
Open-source firmwareCommunity support and unlimited customization.

On-device vs software macros

The main trade-off is portability versus convenience. On-device macros are stored in the keyboard's firmware and work on any computer, regardless of operating system. They are ideal if you move between a desktop, laptop, or work computer. Software macros run in an application on your system and can interact with the OS or other programs more deeply, but they stop working when the software is closed or if you switch to a machine without that software installed.

Some keyboards offer both. A keyboard with on-device memory can store a default profile, while vendor software can edit that profile over a USB or wireless connection. Wireless keyboards may also allow software to configure the device over Bluetooth, but the macros themselves live on the keyboard.

If you choose a keyboard with open-source firmware, you typically get on-device storage. QMK-based keyboards often have a small EEPROM or flash memory that holds the active keymap. You can switch between different keymaps on the fly, which is powerful for users who need different layouts for different tasks.

QMK and VIA: open-source firmware

QMK (Quantum Mechanical Keyboard) is a widely adopted open-source firmware that gives you near-total control over your keyboard. It supports key remapping, macros, layers, RGB lighting, and even custom encoder actions. VIA is a companion application that lets you edit QMK settings without compiling and flashing firmware. This makes programming accessible to users who do not want to write code.

Before buying a keyboard, verify whether it supports QMK or VIA. Many keyboards from brands like Keychron, Epomaker, and Glorious are QMK-compatible. The official QMK website lists supported keyboards, and VIA's website has a similar database. If you see "QMK/VIA compatible" in the specs, you can assume deep programmability.

For a deeper exploration of how QMK and VIA work, see our QMK and VIA firmware guide. That article explains the difference between the two and how to get started.

Choosing a keyboard for macro programming

The best keyboard for macros depends on your layout preference, switch type, and budget. If you want maximum programmability, look for a keyboard that natively supports QMK or VIA. If you prefer a specific brand's software, check that the software offers the features you need.

Size matters: a smaller keyboard like a 65% layout or 75% layout relies heavily on layers, so good software support is crucial. A TKL layout gives you more physical keys, which can be useful if you want dedicated macro keys. Our buying guides can help you compare models.

Consider the key switch type as well. Hot-swappable keyboards let you change switches without soldering, which is useful if you want different tactile feedback for macro keys. Mechanical switches are the most common choice for serious customization, but some membrane keyboards also offer programmable keys.

Ultimately, the keyboard that works best for you is the one whose software and layout you can adapt to your workflow. Start with a layout you are comfortable with, then use remapping and layers to make it your own. For more on layout options, see our keyboard layouts guide.

What to pick for your use

If youPickBuying guide
You want maximum programmability with open-source firmwareA keyboard with QMK/VIA supportBest Mechanical Keyboards in 2026: 15 Picks Compared on Specs
You need a compact keyboard with layers for macrosA 65% or 75% hot-swappable keyboardBest 75% Keyboards in 2026: 15 Picks Compared on Specs
You want to experiment with different switches for macro keysA hot-swappable keyboardBest Hot-Swappable Keyboards in 2026: 13 Picks Compared
You want to use the same macros on multiple computersA keyboard with on-device memoryBest Wireless Mechanical Keyboards in 2026: 15 Picks
You are on a tight budget but still want programmabilityAn entry-level QMK-compatible keyboardBest Keyboards Under $100 in 2026: 15 Picks Compared on Specs

Questions

What is the difference between remapping and a macro?

Remapping changes a single key to output a different key, like swapping Caps Lock for Ctrl. A macro triggers a sequence of events, such as typing a full address or running a multi-step command.

Do I need special software to use macros?

Many keyboards have built-in macro recording that works without software. However, for advanced macros and layers, you may need vendor software or open-source tools like VIA.

Will macros work on any operating system?

If macros are stored on the keyboard, they work on any OS because the keyboard sends the stored key sequence. Software-based macros may be OS-specific.

Can I make a key type a long text string?

Yes, you can record a macro that types any text string, as long as the keyboard's macro memory is large enough. Some keyboards have a limited record time or buffer, so check the specifications.

What is a layer on a keyboard?

A layer is an alternate set of key assignments that activates when you hold a designated key, such as Fn. This lets you fit more functions onto a compact layout.

What changed

  • : First published.

Sources

Related buying guides