2 min read

Building a numpad keyboard

I have a 60% keyboard with magnetic switches that is both silent and really pleasant to use. However, 60% keyboards have their shortcomings, one of them being the lack of a numpad.

Using Blender without a numpad is a nightmare. I had mapped some shortcuts, but even then, it’s a pain. I had an RP2040 Zero lying around unused, and I remembered that it has a HID interface, you can use libraries like KMK or QMK to turn it into a keyboard/ mouse device.

With that in mind, I decided to do just that. I designed a case and got some brown switches to use with it (They're pretty silent). Anyway, here’s the process.


Case

I used keyboard-layout-editor to get the key plate layout and then modeled the case around it using CAD.

Printed result

After that, I started working on the matrix. Since I’d never built a keyboard before, I got some 1N4148 diodes and some metal wires for connections and structural support.

I ended up messing up the matrix, but it works. I just had to invert the keys, lol.

Here's the code:

import board
import board
from kmk.kmk_keyboard import KMKKeyboard
from kmk.scanners import DiodeOrientation
from kmk.keys import KC

keyboard = KMKKeyboard()

keyboard.row_pins = (board.GP2, board.GP3, board.GP4, board.GP5, board.GP6)
keyboard.col_pins = (board.GP7, board.GP8, board.GP9, board.GP10)
keyboard.diode_orientation = DiodeOrientation.COL2ROW

keyboard.keymap = [
    [
        KC.KP_MINUS, KC.KP_ASTERISK, KC.KP_SLASH, KC.NLCK,
        KC.KP_PLUS, KC.KP_9, KC.KP_8, KC.KP_7,
        KC.ENTER, KC.KP_6, KC.KP_5, KC.KP_4,
        KC.LCTL(KC.S), KC.KP_3, KC.KP_2, KC.KP_1,
        KC.LCTL(KC.Y), KC.LCTL(KC.Z), KC.DOT, KC.KP_0,
    ]
]

if __name__ == '__main__':
    keyboard.go()
Good ol’ hot glue.

I added an LED in the end, but meh.. KMK doesn’t handle them that well, so I’ll probably switch to QMK later.

Anyway, Ta-da, the finished result.