Bringing an Apple Extended Keyboard II back to life

Cleaning, whitening and converting it to USB using a Teensy

A while back I wanted a nice mechanical keyboard for my Mac, but didn’t want to spend a whole lot. After searching for a bit, I found a cheap Apple Extended Keyboard II (AEK2) on Ebay and purchased it for around 30€. It was yellow, had a few scratches on some of the keys, but otherwise seemed like in good condition. Keyboards with Alps switches can get serious issues over time, as they seem to handle dirt very badly. There was one other issue: It uses an ADB (Apple Desktop Bus) port and there are basically only three options to make it work via USB, as no modern computer supports ADB: The Griffin ADB-USB adapter, a discontinued adapter and therefor hard to find; a community built adapter; and making the adapter myself using a teensy 2.0. I chose the latter.

This is how they keyboard arrived — really dirty

After I received the keyboard, I removed all keycaps with a removal tool and scrubbed them individually by hand (there are also other ways to clean keycaps, like denture tabs). Then I disassembled the case by removing the screw in the back and after some prying the top opened up. I carefully cleaned and wiped the inside and was happy that my purchase wasn’t too dirty on the inside.

After cleaning I wanted to get rid of the yellowing every ABS plastic experiences after some time. Luckily they keycaps (except the spacebar) on these keyboards are PBT and looked pristine after the wash. The spacebar and the case on the other hand needed to be treated with Retr0bright. Retr0bright is a mixture the community came up with to reverse yellowing of plastic.

What I used to mix my own Retr0bright

I went out and purchased hydrogen peroxide creme used for bleaching hair (I got a 6% solution) and an O2 laundry booster (in my case Vanish Oxi Action), mixed them, applied the cream to the case and the spacebar using a regular brush, covered both with plastic wrap, and put them out in the sun for around 2h. The results were astonishing as seen below:

Cleaned and treated with Retr0bright

The keyboard looked almost like new, so next step was the USB conversion. Thus I bought a Teensy 2.0 USB controller, a few wires commonly used for Arduino tinkering and a 1k Ohm resistor. The TMK ADB-USB converter firmware I wanted to use has a nice readme explaining how ADB works, and it basically comes down to connecting three wires from the keyboard with three ports on the teensy and bridging two of the teensy board ports with a resistor. But don’t worry it sounds more complicated than it actually is.

As I didn’t need any of the ADB ports I removed the left ADB port to route the USB cable through that hole while at the same time using the cable it was connected to to connect with the Teensy. I cut the grey cable connecting to the ADB port PCB off and only leaving the second, the sixth and the eight wire (from the left) sticking out.

Those represent PD0 (2nd), VCC (6th) and GND (8th) respectively on the Teensy. I soldered the cables I bought to the wires sticking out, bridged the connection between D0 and VCC on the teensy with the resistor and soldered the cables into the Teensy. Afterwards I carefully wedged the Teensy into the keyboard and routed a USB cable through the hole created by removing the ADB port.

Sorry for the awful soldering job
The final resting position of the Teensy and the cables

Now to the final stage of the conversion: The firmware. Following the directions on the TMK Github page, I downloaded the files to my Mac. Now I had to figure out what my correct keymap was. As I bought an ISO-DE AEK2 I wanted to use the ISO keymap found as keymap_iso.c. But this keymap has two flaws when it came to the way I wanted to use my keyboard, namely on the Mac and in ISO-DE instead of just ISO. The issues are that using keymap_iso.c the “=” symbol on the numpad doesn’t work on the Mac and the “^" and the “<” keys are switched when using the keyboard in German.

To combat this I made myself a keymap_iso_de.c, which can be downloaded here (just add it to the /tmk_keyboard/converter/adb_usb folder). Otherwise you can copy or edit keymap_iso.c and replace EQL with PEQL on the numpad (enables “=” on numpad on the mac, but disables it on Windows) and switch GRV and NUBS (for German ISO support).

At this point I got to the building phase, so I had to install a few tools: Teensy Loader and CrossPack. After that was done, I opened the Terminal and navigated into the /tmk_keyboard/converter/adb_usb folder using the cd command. Then I ran following commands (use another keymap eg. iso or ansi depending on what AEK2 you have):

sudo make -f Makefile.teensy clean
sudo make -f Makefile.teensy KEYMAP=iso_de

After that was done, I opened the Teensy application, pressed the file icon, navigated to the /tmk_keyboard/converter/adb_usb folder and chose the newly created adb_usb_teensy.hex file. Now I connected the keyboard to my Mac for the first time and pressed the little button on the Teensy board to enter Program Mode. Afterwards I clicked the second button to load the firmware onto the Teensy and then the third button to reboot it (this should open the keyboard assistant where it recognizes the layout). After unplugging and replugging it in (I had some issues if I left this step out) I tested if all keys worked and they did. The only thing I had to do at this point was closing the keyboard case and screw the one screw back in. DONE.

I hope this article is understandable and helps to rescue a few old keyboards by bringing them together with other enthusiasts. If any questions come up, you can hit me up on Twitter or ask questions on the TMK Github page (the creator is very active and helpful).

The cable I used is from