A handwired 4x4 macropad with rotary encoder built on Raspberry Pi Pico.
Loading README and project media…
A custom 4x4 handwired macropad with rotary encoder and dynamic runtime macro updates.
This project is a handwired 4x4 macropad built around a Raspberry Pi Pico and QMK firmware. The firmware maps each physical key to a macro slot, and the host/ scripts can update macros at runtime over raw HID.
The encoder has layer-aware behavior, and the firmware supports 16 logical layers with 16 macros per layer.
hid Python package for raw HID communicationjacco_4x4_macropad_default.uf2 to the RPI-RP2 drive.The firmware maps the 16 keys to macro indices 0..15 on every layer. The actual key behavior is defined by macros, so the board is designed to be configured at runtime via the host scripts in host/.
Encoder: Layer-dependent actions, configured in firmware.
This repo includes a simple Python host-side tool for sending macro updates to the board over raw HID.
host/main.py - sends fragmented raw HID reports to update macro definitions on the device.host/keycode_converter.py - converts human-readable macro expressions like LCTL(KC_C) and SWITCH_LAYER_5 into QMK keycodes.host/qmk_keycodes.py - contains the QMK keycode constants used by the converter.The firmware expects raw HID packets to update:
The sample script in host/main.py demonstrates:
Ctrl+C and erpeating every 100ms until pressed againa and bInstall dependencies:
python3 -m pip install hid
Then run:
python3 host/main.py
Edit host/main.py to send the macro updates you want.
qmk-config/ - QMK keyboard definition and keymap sources
qmk-config/jacco_4x4_macropad/keyboard.json declares keyboard featuresqmk-config/jacco_4x4_macropad/keymaps/default/keymap.c implements the dynamic macro engine and encoder behaviorhardware/ - Handwiring guide, BOM, and assembly instructionscase/ - 3D printable case files
case.3mf - main case designcase.f3d - Fusion 360 design filestl/ - STL files for printingimages/ - Assembly and wiring reference photoshost/ - Python scripts for sending macro updates to the devicecase.3mfSee hardware/README.md for the full Bill of Materials.
Follow hardware/assembly.md to:
Use the Quick Start guide above or compile from QMK after copying the keyboard folder.
Copy qmk-config/jacco_4x4_macropad/ into your local QMK firmware tree under keyboards/.
Example:
cp -r qmk-config/jacco_4x4_macropad ~/qmk_firmware/keyboards/
Then build and flash:
qmk compile -kb jacco_4x4_macropad -km default
qmk flash -kb jacco_4x4_macropad -km default
SWITCH_LAYER_0..SWITCH_LAYER_15.Open source hardware and software. See individual files for specific licenses.