Close

Decoding the Matrix (not that one)

A project log for Hackypuff Jr.

A cheerful little cyberdeck made from a Pi4 and 80s thermal teletype.

CarpespasmCarpespasm 10/03/2020 at 02:010 Comments

In picking my Keeb-conscious friends' minds I quickly learned more thoroughly what I already knew. Mechanical keyboard folks are masochists. While the likes of QMK and custom keyboards are a marvelous thing when they work, there's a learning curve that doubles back on itself if you're not already a decent programmer. I needed something a bit more straightforward to cut my teeth on, and came across an instructable page that does a good job at helping convert arbitrary laptop keyboards to USB with most flavors of Teensy microcontroller:

https://www.instructables.com/How-to-Make-a-USB-Laptop-Keyboard-Controller/

I'm not a complete noob to custom PC controls. I've made custom keyboard hardware for my brother's special needs video players over the years and hacked up an old PS/2 keyboard back in the heady mid-00s to build a MAME cabinet so I knew the way this goes. A keyboard is basically treated like a spreadsheet as far as it's control board sees things. You have two sets of wires (rows and columns) that allow the controller to see every keypress without needing a hundred input pins. The trick is figuring out which combinations go where. The instructables page does a good job explaining how this can be done, but I also made myself a spreadsheet and traced the PCB of the keyboard with a multimeter to help me keep it all straight.

A sample of my reversed pinout.

With that done I read through the instructable a bunch, uploaded random sketches to the teensy that were for different keyboards until I was able to get some random keys working incorrectly so I could figure out what did what. Eventually I sorted out the correct mapping, as shown below.

Discussions