When Advanced Customization Is Needed
- Changing encoder rotation — what happens when you turn the encoder clockwise or counter-clockwise
- Creating or editing firmware macros — multi-step key sequences defined in the keymap source
- Changing default boot behavior — which layer the device starts on
Key Source Files
All source files live in the firmware repository. The files you are most likely to edit are:Understanding the Keymap Structure
The keymap file uses ZMK behaviors to define what each position does. Common behaviors include:&kp— a standard key press (e.g.,&kp C_VOL_UP)&mo— momentarily activate a layer while held&bt— Bluetooth profile actions&rgb_ug— RGB underglow controls&out— toggle between USB and Bluetooth output
bindings array listing all 17 positions: 16 keys in the 4×4 grid, followed by the encoder press on the last line. After the bindings array, sensor-bindings defines the encoder rotation behavior for that layer.
Here is the structure of a layer in the default keymap:
sensor-bindings line defines: CW = C_VOL_UP, CCW = C_VOL_DN.
Changing Encoder Rotation
Encoder rotation is controlled by thesensor-bindings line in each layer. To change it:
- Open
boards/shields/minimalpad/minimalpad.keymapin your fork. - Find the
sensor-bindingsline in the layer you want to change. - Replace the two behaviors with your desired CW and CCW actions.
sensor-rotate behavior, as in the default btled_layer):
sensor-bindings = <&rgb_encoder>;
&inc_dec_kp works for standard key presses. For RGB or other non-keypress behaviors, define a zmk,behavior-sensor-rotate block as shown above.minimalpad_with_studio artifact, and flash it. See Build with GitHub Actions and Install Firmware.
Creating a Firmware Macro
Firmware macros let you emit a precise sequence of key events — useful for text snippets, complex shortcuts, or application-specific sequences. They are defined in the keymap file and compiled into the firmware. Basic steps:- Define a
¯obehavior block in thebehaviorssection of the keymap file:
- Assign it to a key position in a layer’s
bindingsarray:
- Build and flash the new firmware.
Macro sequences are compiled into the firmware. Once flashed, the macro itself cannot be edited from Studio — only its key assignment position can be changed. To update the sequence, edit the source and reflash.
Full ZMK Reference
MinimalPad uses standard ZMK firmware. For anything beyond the examples above — custom behaviors, combos, hold-tap configuration, and more — the ZMK documentation is the authoritative reference.After Editing
Once you have made your changes:- Commit and push to your forked repository.
- GitHub Actions builds the firmware automatically. See Build with GitHub Actions.
- Download the
minimalpad_with_studioartifact and flash it. See Install Firmware.