I needed a ADB to USB keyboard converter to test a feel of ADB keyboards on actual usage. After 2days coding and several hours debug, I made this converter based on my keyboard firmware. If you are interested in ADB keyboard converter, try this.
You can buy preassembled TMK ADB-USB converter hereKeymap EditorYou can edit keymap and download firmware with web browser.
TMK ADB-USB converter rev2(ATMega32u2)TMK ADB-USB converter rev1 and converter with Teensy2.0 or ProMicro(ATMega32u4)In the Keymap Editor physical key layout is based on Apple Extended Keyboard(AEK) but you can edit keymap of any other ADB keyboards. For example when you want to edit arrow keys on M0116 you can just change them on the Keymap Editor. The key layout of M0116 is physically different but logically identical to AEK.
README FIRSThttps://github.com/tmk/tmk_keyboardhttps://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usband optionally,
https://github.com/tmk/tmk_keyboard/wikihttps://github.com/tmk/tmk_keyboard/labels/NOTENEED HELP: Your self-made converter doesn't work?Don't ask help before placing pull-up resistor and trying solder on J1!You are cheap and got Pro Micro from unreliable source, instead of Sparkfun? OK, but confirm it has
16MHz crystal. And probably you need to
fill solder on jumper J1 to feed keyboard good power supply 5V if you are in trouble and J1 is not soldered yet. See
this post and
schematic.
In most cases your wiring is wrong. Check your wiring yourself again and again, one hundred times! And try swapping wires at your own risk, note that your wiring are already wrong at this point probably

It won't break your keyboard unless you are extremely unlucky.
Now you need help? OK. If you are not sure about your wiring,
post pics of your hardware and wriring this really save our time. Don't save your time by omitting this. Shots of controller side and ADB connector/keyboard side would be helpful. If you edit code
post your code. Don't hesitate to show your dirty code! Also
output from hid_listen command would be useful to debug hardware and firmware.
[rant]
Many people said they are sure their wiring is fine first but it became clear they failed to do that in the end
many times in this thread

And they often omit pull-up resistor for no reason, you must have it.
Don't take advantage of generosity of kind and helpful members(yes, including me, of course
)! Their time is more precious than your time, use your time to learn and look into your problem first.
[/rant]
DEBUGYou can use
hid_listen to see debug prints.
UPDATE2012/12/12 Extended keyboard support by
blargg2013/04/08 Fix issue:
ADB-USB converter misses keystrokes (NOT FIXED COMPLETELY)2013/07/22 Changed Pin usage:
PD0, NOT PF0 now
2013/10/11 WIP: Fix
ADB-USB converter misses keystrokes2013/11/28
Fix key drop problem finally Thank you,
blargg!
2015/04/28 Mouse is supported by
mek-apelsin2015/12/18 Request for help: extended mouse support
2016/06/04 Added LIMITATION section
2016/06/04 Apple Adjustable Keyboard media keys are supported now
2016/09/03 Keymap editor(unimap) is available now
2018/01/19 Fix lag problem on ADB-USB converter2019/06/23 Added Apple Extended Mouse Protocol and Kensignton Turbo Mouse support2020-02-13 Updated firmware to fix AEK support
2021-01-24 Change default mapping for 'keypad ='
LIMITATION-
Hotswap of keyboard is not fully supported, you will have to connect keyboard with the converter first, then plug-in USB port. You can hotswap mouse, though.
SOURCE CODEhttps://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usbBUILD FIRMWAREhttps://github.com/tmk/tmk_keyboard/blob/master/doc/build.mdUse 'make' to build firmware for TMK ADB-USB converter rev.2.
Use 'make -f Makefile.rev1' to build firmware for TMK ADB-USB converter rev.1, Teensy2.0 or Pro Micro.
You are recommended to use Keymap Editor above, instead build yourself.
BUILD CONVERTER YOURSELFYou can use PJRC Teensy or other dev board with ATMega32U4/2.
ADB female socket from the front:
,--_--.
/ o4 3o \ 1: DATA
| o2 1o | 2: Power SW
- === - 3: VCC
`-___-' 4: GND
Connect keyboard
DATA line to
PD0(
Pin3 on Pro Micro),
VCC to 5V(
VCC on Pro Micro, not RAW) and
GND as well.
Power SW is not used.
You must have a external pull-up resistor(1K is recommended but any of 1K-10K works) on DATA line.Keyboard Conveter
,------.
VCC---------+--|VCC |
| | |
R | |
| | |
DATA--------+--|PD0 |
| |
GND------------|GND |
`------'
R: 1K Ohm resistor
https://github.com/tmk/tmk_keyboard/wiki/FAQ#pull-up-resistorAEK left/right modifiers discrimination, ISO layout and Adjustable keyboard media keysTo use these features you have to connect keyboard to the converter first before plug-in USB port.
Keyboard initilization needed for the features occurs only when the converter powers up with current firmware.
On ADB Standard keyboards left and right corresponding modifiers are logically indentical and can not be discriminated one another by the converter. This is ADB keyboard limitation, not converter's.
Apple Extended keyboard can discriminate them except for 'Command' key.
ISO keysThe ISO keys are supported. To let the converter recognize ISO layout correctly see above.
iMate and uKey have problem on some keys reportedly.
https://geekhack.org/index.php?topic=4185.msg61270#msg61270https://github.com/randyrants/sharpkeys/issues/225#issue-537872871Power keyIn default configuration Power key works as 'Magic command' trigger key when it is held, or as Power when tapping.
https://github.com/tmk/tmk_keyboard#magic-commandsYou may need to change thse line in config.h if 'Magic command' interferes with your keymap.
https://github.com/tmk/tmk_keyboard/blob/7b31d1b9d9f0d9c7d1e4b553e583381552cd8778/converter/adb_usb/config.h#L54-L57Keypad =The key is assigned to keycode 'EQL'(usual equal) on default keymap.
Note that keycode 'PEQL'(keypad equal) works on Linux and MacOS but doesn't on Windows. If you are on Windows you will need to use 'EQL'.
Locking CapsLockMany of old ADB keyboards have mechanically locking switch for Caps lock and TMK supports them.
https://github.com/tmk/tmk_keyboard#mechanical-locking-supportOr you may want to remove locking pin from the push-lock switch to use it as a normal momentary switch.
http://www.youtube.com/watch?v=9wqnt2mGJ2YCaps lock key of Apple adjustable keyboard is not mechanical locking switch but it emulates locking switch behaviour. You will have problem when using the key as control, for example.
ADB protocol ResourceThis is code for ADB protocol:
https://github.com/tmk/tmk_core/blob/master/protocol/adb.c#L301-L478Extended mouse protocol support-
Kensington Turbo Mouse 5(by hasu)
Do you have other multiple button mouse to support? Check this issue on github and ask help in this thread.
https://github.com/tmk/tmk_keyboard/issues/274TESTED DEVICES- Apple Extended Keyboard M0115
- Apple Extended Keyboard II M3501
- Apple Standard Keyboard M0116, M0118
- Apple Adjustable Keyboard M1242
- Apple Desktop Bus Keyboard(Apple II GS Keyboard) 658-4081
- Apple Desktop Bus Mouse G5431(Taiwan)
- Apple Desktop Bus Mouse II M2706(Taiwan)
- Kensington Turbo Mouse 5 #64210
ISSUES- Apple Desktop Bus Mouse II(M2706) assembled in Ireland doesn't work due to initialization failure. Meanwhile, M2706 assembled in Taiwan works.
https://geekhack.org/index.php?topic=14290.msg2873443#msg2873443https://geekhack.org/index.php?topic=14290.msg2875515#msg2875515OLD STUFF: More