January 4, 2026
Description
The non-printed parts for this are:
an Adafruit Trinket M0 microcontroller
six MX key switches
The switches sit in the tray, with their leads sticking out the bottom. The microcontroller rests on 4 pegs inside the box. You'll also need some hookup wire to connect the microcontroller to the keys, and a micro USB to USB-A or USB-C cable to connect the keypad to your computer.
Everything can be printed in PLA at 0.4mm layer height. The key markings are recessed by 0.4mm, so doing a filament change at 0.6mm and 0.8mm will give the keys contrasting text.
Make sure you fit the key switches into the tray before wiring them up.
The switches have 2 leads. Wire one lead of each of the 3 left switches together. Do the same for the right switches. These will be your 2 column wires. Connect these to pins A3 and A4 on the Trinket.
Wire the other side of the switches in side-by-side pairs. These will be your 3 row wires. Connect these to pins A0, A1 and A2 of the Trinket.
For example, I've got the left column connected to A4, the right column to A3, and the top, middle and bottom rows to A1, A2 and A0 respectively. It doesn't really matter what order you put them in, as long as the Arduino code matches the connections (lines 263, 264 of the .ino file)
The code supplied here emulates a USB keyboard and generates Alt sequences for typing special characters. NOTE: This only works for Windows machines. The key sequences for Linux, Chromebook and Mac machines are completely different.
Also, the Alt sequences tend to work only if numlock is on. I've updated the code to toggle numlock if the bottom 2 keys are pressed at the same time. This can come in handy if you're hooked up to a laptop that doesn't have a numlock key.
Lines 42-211 define the Alt sequence for each possible key. When a key is pressed, the microcontroller sends out an Alt key down, followed by 3 or 4 keystrokes on the numpad, followed by an Alt key up.
Line 36 defines which of the alt sequences to use for each key (left to right, top to bottom).
The Arduino IDE should handle the code with too much trouble. You'll probably need to have it download a bunch of libraries and board profiles, though.
With a few changes to the Arduino code, it can be repurposed to work with non-Windows machines, or for use as a macro pad.
There are no fasteners involved. Everything is friction-fit.
Fit the keycaps onto the key switches before fitting the tray into the box.
Once the keys and Trinket are wired up, push them into the the box, with the Trinket sitting on the 4 pegs. It's a bit fiddly to get the Trinket in place, especially once it's wired up. Place the tray containing the keys on the rim around the inside of the box.
It should just work. After it's been programmed, the keypad should be usable by any Windows PC.
There's a bunch of extra code in the .ino file to allow for reprogramming the keys on the fly, but it's probably not worth messing with.
License:
Creative Commons — Attribution