Skip to content

Edit the Keymap

This HowTo changes what the keys do. There are two routes — pick by how permanent the change is and how much it changes:

Route Best for Recompile? Survives a reflash?
1. PolyKybdHost Layout Editor Remapping individual keys, quickly No Yes — kept in the keyboard’s EEPROM*
2. QMK firmware source Permanent keymaps, layers, macros — and behaviour beyond the keymap Yes Yes — it is the compiled default

Background on layers and the dynamic keymap is on Keymaps & Layers.

Route 1 — PolyKybdHost Layout Editor (runtime)

Section titled “Route 1 — PolyKybdHost Layout Editor (runtime)”

The fastest route. Right-click the PolyKybdHost tray icon → Configure Keymap, click a key, pick a keycode, and it’s written to the keyboard over HID immediately — no recompile. It writes a single key at a time (ID_DYNAMIC_KEYMAP_SET_KEYCODE) and the change persists across power cycles.

Full walkthrough and limitations: Keymap Editor.

Editing the firmware does much more than remap keys: new layers, macros, tap-dance, encoder behaviour and any custom QMK logic. It also makes your change the compiled default, so it is on a fresh board and is what you share or submit to the main project.

The keymap data — the keymaps[] array, g_led_config, and encoder_map[] — is stored per variant:

keyboards/polykybd/split72/keymaps/default/keymap.c
keyboards/polykybd/split42/keymaps/default/keymap.c

The shared keymap logic (rendering, HID handling, the QMK callbacks) is in keyboards/polykybd/poly_keymap.c. Both are in the qmk_firmware fork; see Keyboard Variants for why the logic is shared but the data is per-variant.

  1. Start from a copy so you can fall back to the default:

    Terminal window
    qmk new-keymap -kb polykybd/split72 -km my_keymap # or /split42
  2. Make the change in keymaps[] (each layer is a LAYOUT_left_right_stacked(...) of keycodes):

    Replace a keycode, or add another [n] = LAYOUT_left_right_stacked(...) entry plus a key that reaches it: MO(n) (momentary) or TG(n) (toggle). The keymap already uses all 12 layers that DYNAMIC_KEYMAP_LAYER_COUNT allows (in the variant’s config.h), so a new layer also needs that count raised. Only layers 0–7 can be changed later in the Keymap Editor. QMK’s keycode reference is at docs.qmk.fm/keycodes.

  3. Rebuild and flash per Build & Flash from Source:

    Terminal window
    qmk compile -kb polykybd/split72 -km my_keymap

A keymap change appears on the per-key displays automatically — the firmware re-derives every legend from the active layer.

See Contributing if you want to submit a keymap change to the main project.