The completed controller

The completed controller

This is a project from 2004. I had it covered extensively on my old homepage, including some more pictures, circuit diagrams and a description on how I analyzed the keyboard controller.

Nowadays, PCs don’t have a PS/2-interface anymore. I’d base a project like this on microcontrollers if I would do it again, and interface the computer via USB. So I leave the details in the past and give just a short description of the project.

At that time, I was interested in MAME, the Multi Arcade Machine Emulator. You can play all the old arcade game classics with that. A PC keyboard is not the ideal interface for thos games, so I started building my own controllers.



Originally, the joysticks were sold to fit a Sega Dreamcast console. I threw out the electronics and implanted a PC keyboard controller instead. I had to find out the keyboard matrix layout and interface all the joysticks microswitches to the right contacts on the controller board. Not too complicated.

The second player’s contacts were connected to a second unit with an old serial cable. Additionally, I built a Y-adapter for the PS/2-interface, so I was able to control the PC outside of MAME.

The result surely wasn’t a pretty build, but: it worked. :-D

Nowadays, I don’t have a PC with a PS/2-interface anymore. I already dismantled one of the joysticks and built something else. But that’s a different story…

See also…

I mentioned this project in an article (german only) on this blog, it dates back from November 2012. Somehow I never showed it, I don’t really know why.

Those who read this blog for a while know that I have a deep faible for computer keyboards. You don’t get the full picture from my english language articles, but in german you can find many keyboard related articles on this site.

Amongst others, my collection contains two vintage Apple keyboards. There’s a — really not too shabby — Apple Extended Keyboard II, which was built between 1990 and 1994. Many enthusiasts claim that this is the best keyboard ever produced by Apple, partly of course because of it’s mechanical nature with the Alps switches.

Even more original — and in my eyes it’s a typical Apple product — is the Apple Adjustable Keyboard, 1993 vintage. Typical Apple? As I said, in my eyes: it was expensive for its time, and above all the visual appearance of the product is more important than functionality. Even though there are arrow-keys on the main keyboard, I personally wouldn’t want to miss function- and navigation-keys (Home, End, PgUp, PgDown). And if you connect the additional keypad, you really have to have long arms to reach your mouse… :-/

However, I wanted to give both a try. And since I don’t have access to a computer with ADB interface — Apple killed it in 1999 — I needed a converter. You can buy this stuff, but you don’t have to.

On, there’s a japanese developer called hasu, who is tmk on Github. He created and published the TMK Keyboard Firmware Collection. That’s a firmware that can be run on several AVR-based platforms, notably the Teensy 2.0 which is well known in keyboard communities. The firmware is able to ‘talk’ several different keyboard protocols. Of course, USB in one direction, to be connected to any modern computer. In the other direction there are protocols like PS/2, Sun or Apple Desktop Bus. The custom firmware is loaded with features even expensive modern high end boards fail to deliver. It’s possible to program macros, use media keys or control the mouse pointer with the keyboard.

Unfortunately, I didn’t have a Teensy at home. But I had all the parts to build something compatible, and all the tools to etch a fitting PCB. So I fired up KiCad and designed a minimal circuit, from that it wasn’t too difficult to create a PCB layout:

(The KiCad files need a bit of a workover, so I won’t publish them here. But it should be easy to recreate the circuit following the two screenshots.)

ADB USB Converter

ADB USB Converter

The finished converter measures in at 2x5cm, that’s really tiny. But the important thing is: it works!

I could probably use the ADB mouse with an off-the-shelf converter. But honestly: even a hardcore fanboy would prefer a modern pointing device without the ball in it. That is: a while ago I had the opportunity to play a bit with System 7.5 (the Apple operating system from the same era as the two keyboards), and I have to confess that the Adjustable Keyboard did its part for the authentic user experience… :-D

I didn’t have this project on the blog in 2008, I copied it from the old CMS in 2015.

Looks like the day it was made -- except for the cable

Looks like the day it was made — except for the cable

A ‘hammered dulcimer’ is a musical instrument, its german name is ‘Hackbrett’. But you also can loosely translate ‘Hackbrett’ to ‘hackboard’, which I think is a great name for this kind of keyboard. A funny fact on the side is, that the name ‘Dulcimer’ originates from the latin ‘dulce melos’, which means ‘sweet sound’. If you ever heard someone type away on a Model M, you know why I chose this name… ;-)

A computer keyboard can be a very personal utensil. Especially if it is an extraordinary well built one, like for example the IBM Model M. The Model M design dates back to 1984, but it still has many fans even nowadays. It came with the usual keyboard connectors. First the old 5-pin one, later a PS/2 plug. Unfortunately is that, at least to my knowledge, they never released a version with USB.

A friend of mine knew that I already had built other USB-devices, and one of them even acted as a keyboard (it isn’t really a keyboard, but that’s a different story… ;-) ). He is a big fan of the Model M, so he asked if I could put new life in one of his old keyboards, which had a broken circuit inside. And this is the result…

Hard- and Software

A first prototype

A first prototype

The main part of a computer keyboard circuit is the key matrix. You can imagine it as a number of keys, placed on a raster of horizontal (rows) and vertical (columns) wires. In the case of a Model M keyboard, we have a matrix of 8×16 lines. Eight columns in 16 rows, or the other way around, depending on how you look at it. Each key is connected to one column and one row. If you press the key, it will connect the column and the row on it’s crossing of the lines.

Connected to this matrix is a keyboard controller. That’s a chip with a number of I/O-lines to detect the state of the matrix, and on the other side an interface that enables it to talk to the computer. Oh, and not to forget: it also has three output lines to drive the LEDs for Num-, Caps- and Scroll-lock.

What I did in this project is, that I dumped the keyboard controller chip and its circuit, and replaced it by an ATmega32 and my own circuit. The ATmega scans the matrix for keyboard activity, controls the LEDs and talks to the computer.

For further convenience, I added a boot-loader. With that, it is possible to update the keyboard’s firmware without disassembling it, and without the need for a dedicated programmer.

Other Hardware?



As mentioned, the controller in this project is just connected to an ordinary keyboard matrix. You can find this kind of matrix in all kinds of keyboards, from key-telephones over good old hardware like the Commodore C=64 or the Schneider CPC, keyboards with non-PC-connectors like those made by Sun, to modern hardware that could need a few more features.

Till now, I just made a PCB layout for the IBM Model M, but I intend to modify at least a Sun keyboard. In order to do that, I expect having to refactor the key-scanning, since the key-matrix is not 16×8. The positions of the keys on the matrix will be different, I’ll have to re-engineer that. And of course, I’ll have to make another PCB.


Powered by Kicad

Powered by Kicad

At the moment, the keyboard should be able to do everything that the average off-the-shelf-keyboard can do. But there are many features that are possible, regarding the fact that the ATmega32 is absolutely bored till now. You can think of ‘magic keystrokes’ that turn some hidden features on or off, like for example:

  • send complete phrases on one keystroke
  • ‘autofire’ feature on keys that don’t repeat normally, for example Alt+F4
  • change keyboard layout without reconfiguring the computer
  • turn bouncing keys on or off, to annoy other people using your computer
  • random caps lock function
  • use arrow keys as mouse, without having to include a special driver in the OS.

With a little tweaking on the hardware side, there should be even more possibilities:

  • turn the oldtimer-keyboard into a supermodern wireless bluetooth one
  • implement keylogger-funktionality, using for example an SD-card
  • include an USB-hub into the keyboard

If you are just a little like me, it won’t take you much brainstorming to come up with own useful — or even better: useless — ideas. ;-)


Connect the keyboard to the USB-port. All LED should flash up to indicate that the device is initialized.

Then you can use the keyboard as always. If additional features get implemented, you will be able to use them in their respective ways.


I don’t know if and how keyboard manufacturers face the problem of ghost keys, I didn’t take special measurements for this. I hope that the engineers at IBM distributed the keys on the matrix in a way that minimizes this problem. Don’t misunderstand: I haven’t experienced that on this keyboard, but I know that it’s a common problem on key-matrixes.


Modern oldtimer

Modern oldtimer

I’d like to thank Objective Development for the possibility to use their driver for my project. In fact, this project wouldn’t exist without the driver.

I took great inspiration from Spaceman Spiff’s c64key, this software is based on his ideas.

Further credits go to xleave, who etched the PCB for me, and also answered many stupid questions about electronics I had during the last few years.

And of course I’d like to thank FaUl of the Chaostreff Dortmund who gave me the idea for this project.

About the license

My work – all contents except for the USB driver – is licensed under the GNU General Public License (GPL). A copy of the GPL is included in License.txt. The driver itself is licensed under a special license by Objective Development. See firmware/usbdrv/License.txt for further info.


See also…

  • – dedicated to IBM Model M
  • RUMP – practically the same project, a parallel development
  • Geekhack – protoboard version, based on Dulcimer