Skip to content

Layers and Macros

You'll build QMK or ZMK firmware from source for a board you own, write a keymap with three layers and a macro, and live on it for a week.

About

The web configurator is a fine place to start, but the real firmware lives in a text file, and once you can edit it you can make a keyboard do anything a keyboard can do. You'll set up the toolchain, write a keymap with a base layer, a navigation layer and a function layer, add a tap-hold key that's one thing when tapped and another when held, and record a macro that types something you type every day. A 60 percent board or anything smaller is where layers earn their keep. Anything that happens on the computer after the keypress (window switching, scripts, text expansion in an app) belongs to Automation & Scripts, so keep this one inside the firmware.

At a glance

Per requirement
25 XP
Completion bonus
150 XP
Requirements
5
Takes
One weekend
Skill level
Intermediate (months of practice)
Cost
Free
Supplies
You need some
Where
At home
Other people
On your own
Locked for now
Earn two more Common badges in Mechanical Keyboards to open this one. Log in to see how far along you are.

Requirements

  1. 1
    Install the toolchain and compile the stock keymap for your board. QMK has a one-line setup command and ZMK builds in the cloud through GitHub Actions, so pick whichever your board supports. Compiling the stock keymap first tells you the toolchain works before you've changed anything, which saves an evening of blaming your own code. Take a screenshot of the successful build output. Photo
  2. 2
    Write a keymap with a base, a navigation and a function layer. Put arrows under the right hand on the navigation layer (H, J, K, L or I, J, K, L are the usual picks), the function keys along the number row of the function layer, and media keys wherever your hand lands. Take a screenshot of the layer definitions in your keymap file. Photo
  3. 3
    Add one tap-hold key and tune its timing. A key that sends Escape on a tap and goes to the navigation layer on a hold is the classic. The default tapping term is about 200 ms, and if you keep getting the wrong one, change that number by 25 ms at a time rather than giving up. Take a screenshot of the tap-hold definition and the tapping term you settled on. Photo
  4. 4
    Record a macro for something you type every day. Good candidates are an email address, a code snippet, or a bracket pair with the cursor left between them. Leave passwords out of it, since firmware macros are plain text on a device anyone can plug in. Film the macro firing. Video
  5. 5
    Flash it and use the board for a week with a cheat sheet taped to the desk. Flashing modes vary: a reset button on the back, a key combination, or shorting two pins with tweezers. By day four you'll stop looking at the sheet. Take a photo of the sheet and tell us the one binding you changed during the week. Photo