QMK. QMK is written in C and has a large community behind it and a lot of controllers support QMK. There are other firmwares like ZMK and TMK and so on. All these are quite complex to start with and it takes some experience with C to CMake to start with. C was overkill for me 🙈.
I searched over Reddit and GitHub and found about KMK. KMK is in Python 🐍. KMK allows to program the keyboard/controller with Python and it works on top of CircuitPython which makes it even better. CircuitPython is by the folks at Adafruit which makes good electronic Components and related software(Their macropad is very cool). I also contributed a bit of docs to the KMK project which were a bit confusing at first.
Programming the board was the easiet part of the build. It took a bit of trial-and-error to program it fully. Honestly I actually didn’t have a clear idea on what I should program the keys to do and later ended up keymaps to mute and unmute Google Meet calls for Online class. I also added some media key support and led animation switching. Also added a keymap to call Spotlight/Siri(hold) in Mac. Since the RPI Pico only needs a single code.py
file to run when connected, it makes a lot simple to use the macropad. Plug-n-Play FTW!
Here is the whole config for the macropad.
import board
from kmk.extensions.LED import LED
from kmk.extensions.media_keys import MediaKeys
from kmk.handlers.sequences import send_string as ss
from kmk.keys import KC
from kmk.kmk_keyboard import KMKKeyboard
from kmk.matrix import DiodeOrientation
keyboard = KMKKeyboard()
led_ext = LED(
led_pin=board.GP0,
brightness_step=5,
brightness_limit=100,
breathe_center=1.5,
animation_mode=3,
animation_speed=0.1,
val=100,
)
keyboard.extensions = [led_ext, MediaKeys()]
# keyboard.debug_enabled = True
keyboard.col_pins = (board.GP19, board.GP20, board.GP21)
keyboard.row_pins = (board.GP11, board.GP12, board.GP13)
keyboard.diode_orientation = DiodeOrientation.COLUMNS
GMEET_MIC = KC.LGUI(KC.D)
GMEET_VID = KC.LGUI(KC.E)
send_roll_no = ss("15 ")
keyboard.keymap = [
[
KC.LGUI(KC.C),KC.LGUI(KC.V),KC.LGUI(KC.SPC), # 1st row
KC.LED_TOG,KC.MPLY,KC.MNXT, # 2nd Row
GMEET_VID,GMEET_MIC,send_roll_no, # 3rd Row
]
]
if __name__ == "__main__":
keyboard.go()
With this the whole macropad works. I also added a Breathe LED animation with a single LED lying around. The case is translucent and the breathe animation gives it a good aesthetic to the macropad and the desk. I had some old(like really old) keycaps lying around and added that to the keyboard which gave a retro look to the whole macropad. I’m very proud of myself with how it turned out.
Here is the final image after the build.