Hacker News new | past | comments | ask | show | jobs | submit login
Building a USB to Mac ADB keyboard adapter (paperstack.com)
117 points by dcminter 4 months ago | hide | past | favorite | 61 comments



FTA: “Apple always did things a bit differently, so while the IBM PC derived machines had more-or-less standardised on the PS/2 based connectors, Macs had their own serial bus system for keyboards and mice“

That’s a bit unfair towards Apple. ADB is from 1986 (https://en.wikipedia.org/wiki/Apple_Desktop_Bus), PS/2 from 1987 (https://en.wikipedia.org/wiki/PS/2_port), so they couldn’t have used PS/2.


Ha! I should have researched that instead of relying on my fading memory of the era. I'll footnote your point when I get a chance to update the post.


Also, PS2 mouses and keyboards have physically identical but electrically incompatible connectors, which is like a precursor of the nightmare that is USB. ADB is positively magic in comparison.


And not hot-pluggable. I lost track of how many motherboards I had to replace due to hot-plugging PS2 devices.

Note: keyboards and mice were pretty low risk. High risk were PS2-based barcode scanners.


Well, nothing will break if you mix them up. It's just the command protocol which is different. I recall there was a Linux hack-patch which could use an extra keyboard in the mouse connector.

Not to say there weren't problems. I had a Compaq couldn't speak to most PS/2 keyboards, so when my keyboard broke, I had to go find another Compaq keyboard on campus before I could use the computer again.


Sudden flashbacks to the "PS/2 to USB" adapters that came with some keyboards, but were just electrical connections, no adapter at all. So they'd only work with keyboards that were able to speak both USB and PS/2.


The (1984) PC/AT keyboard has the same protocol as the PS/2 keyboard.


and a connector that is 5x the size of the ADB connector. I mean, just look at that thing. It's huge. It's ginormous. No wonder Apple didn't go with that thing. Instead, they used a connector that had pins that would easily bend if it was accidentally attempted to be inserted into the wrong port.


Worse, that connector was used on all sorts of things. That same connector was used for power delivery on some computers, midi keyboards, and monitor outputs. People blew up their sewing machine plugging a keyboard into a port. I'm sure there were more uses of that same connector for other things that were electrical incompatible. At least the PS/2 (and ADB) ports were used only for one purpose (PS/2 two - they should have either made mouse and keyboard interchangeable, or made them different, but just keyboard or mouse was a big improvement).


They could have picked the PC keyboard protocol and used their own connectors, if they wanted to.


Almost every time there is "Why Apple did X while Y was available" shows that X was released before Y.


While Apple couldnt have used PS/2 mini-DIN connector, they could have adopted electrical signaling and protocol as it was reused from 1984 AT keyboards.


However if you want to go the other way and use USB keyboards on ADB mac (and many others), check out my USB4VC project: https://github.com/dekuNukem/USB4VC


And if you have even older Mac (128/512/Plus) and want to use an almost modern PS/2 keyboard with it, please check my https://github.com/trekawek/mac-plus-ps2


And if you have an obscure Canadian TV computer from 1982 and want to use a USB keyboard with it, check out my https://youtu.be/93LBVhSx8cs?si=bC8OW3SpWIIlsgNN

(I should really get around to taking that project beyond the prototype stage)

Seems like keyboard adapters are a popular thing around here.


Or if you have a Mac of that vintage and want to use its mouse on your modern PC, you can use my adapter: https://jfloren.net/b/2022/7/8/0

(I recommend against doing this except as a party trick, because these old mice were never intended to be used on a high-resolution screen)


What I would love is to be able to use modern laser mice with vintage PCs -- I have a Mac Plus which is a nightmare to use because those old ball mice are flippin' terrible.


I think you could fake the quadrature signals pretty easily. When I designed my laser mouse, I initially wanted to be able to reprogram the microcontroller to output USB, PS/2, quadrature, etc. but that got dropped so as to just get it out the door... but I think a USB->quadrature adapter would be pretty doable.


I have a 512ke and no keyboard, keep looking for ways to use a "modern" board on it instead if paying a good $ on Ebay for one. This is exactly what I was looking for, thank you.


Thank you for this! I am just about to fix the PSU on my Mac Plus 1MB and this might come in handy.


Excellent! From the headline I expected the article's project to be USB keyboard -> ADB host, not the other way round - so I'm glad to see such a project does exist!


I was going to recommend the Griffin iMate ADB-to-USB adapter, I have a couple, but apparently they’re hard to find now and expensive [1]?

I paid $35 for one brand new on Amazon just a couple years back.

I too used an old Apple keyboard when I first started using a Mac for work because the flat keyboard’s were nightmarish. I moved to a HHKB Lite 2 [2], and through several other keyboards before ultimate landing on a UNIX layout Sun Type 7 as my Mac keyboard of choice.

- [1] https://www.amazon.com/gp/product/B000067V8L/

- [2] https://donatstudios.com/UNIX-Keyboards


Judging by Griffin’s site having its account suspended… I think they probably went out of business?

That’s a shame, they made some neat stuff over the years.

https://griffintechnology.com/


The Griffin brand is still around:

https://incipio.com/pages/griffintechnology

Owned by the same company that owns Incase and Survivior. I can’t quite tell if the company and/or brand were bought, or if the company renamed itself. Their products don’t seem nearly as innovative as the old Griffin was though.

[Edit: oh, hey, they’re the same company that recently bought the Microsoft accessory designs: https://www.incase.com/pages/incase-designed-by-microsoft]


If you find an old iMate and it doesn't work - tear it open. There's a "non-replacable" battery inside and if it dies it stops working.


Somebody just last year finally worked out what that battery is doing and why the adapter doesn’t work after it dies: https://www.projectgus.com/2023/04/griffin-imate/#mystery-ba... (discussed on HN: https://news.ycombinator.com/item?id=35772131)

(TLDR: compatibility with Apple’s off-USB-spec keyboard power button, but the circuit they used accidentally injects noise which wreaks havoc on the data lines when it’s unpowered and left floating.)


That's interesting. My iMate is flaky — I'll pop it open and check!


The UNIX layout is also my favorite layout by a mile. The backspace and control keys position is so much more natural, I don't understand why it didn't become the default layout.


It really is one of those sub-optimal designs that you dont really think about, until you do think about it, and then it makes no sense!

At one point Apple did make one keyboard with the CTRL key in the correct place!

The CAPSLOCK key is, for me, the most useless key.

Who uses it and why! LOL

I should really remap CAPSLOCK be CTRL on my Mac, but I dont use CTRL that often and prefer just to roll with the stock defaults most of the time.

EDIT: I quickly Binged the Mac keyboard I was thinking of, and got this result:

* https://controlaltbackspace.org/ctrl/

> There’s a better place to put it, right on a large, easy-to-press key that you rarely use: Caps Lock. A few keyboards throughout the years have gotten this right, like Apple’s Standard Keyboard for the Macintosh II and SE:


Revising caps lock makes perfect sense since it's obsolete.

The backspace key has been at the location it is (far right of number row) for well over 100 years. Indeed its placement preceeds the existence of the Return key, as prior to the IBM Electric (1935) and similar, typewriters had a manual carriage return bar. That's a century of keyboards and muscle memory that you're trying to undo.

As a touch typist, any keyboard that moved the backspace key would be awful. Still better than the ergonomic nightmare that is the ISO european keyboard.


I've been remapping caps lock to backspace for more than a decade now, I have backspace mapped to (forward) delete. This was due to the only repetitive stress injury a keyboard has ever given me, which was strain in the outside of my right wrist from the frequency with which I would go after the backspace key.

Also, aesthetically, I like the fact that backspace is to the left and delete to the right, the directions in which the command acts. But mainly, I'm not an especially accurate typist, and I change my mind a lot, a home row backspace is a godsend.

This remap leads to some pretty comical results when I find myself using a board which doesn't have them, the first time I make a mistake it STAYS ANd I get something like that, a run of capital letters and then lowercase as I instinctively hit caps lock again to try and delete them.


Very cool! I love that it's so accessible to do this kind of thing these days, and the addition of a 3D-printed custom case is awesome. I do think there's a tiny bit of humble brag with the author's skill level, but that worked well in this case.

It also reminded me of another piece of evidence for the difficulty in computing to name things:

Keyboard have had the keys F1, F2, and so on since at least the 80s. They are called "function keys", and modern PCs have 12 of them.

Then some time during the 90s (I guess?) laptop manufacturers decided they needed to squeeze more functionality into ordinary letter keys, and invented the a new key to enable the alternate functions. Obviously, then, they had to name that key "Fn", for "function".

On my work Dell machine I can press "function function 1" to mute or unmute the audio, for instance. Fantastic.


> humble brag

Heh. Not intentionally. All the hard work is the QMK project and nothing to do with me. TinkerCAD is literally designed for kids and completely the wrong tool for the job. I'm pleased (and faintly surprised) with how well it turned out, though, so perhaps a little bragging there.

Good point about the "fn" versus "F" key naming overload!


The Fn key existed at least as early as the PCjr, where you'd use Fn-1 to Fn-0 instead of dedicated function keys. This was also seen on some smaller laptops without room for dedicated function keys. (Other designs used Fn-F1 and Fn-F2 to add F11 and F12 when there wasn't room)


> Incidentally, if you were in a whimsical student mood, you could also chain all of the keyboards on a row of machines end to end resulting in five or six machines completely unconnected from their keyboard and the one at the end taking any and all input from the neighbours.

At about age 10, my brother and I chained two keyboards together and played video games like that. Once we did four with some friends but Escape Velocity would slow down to a complete crawl. Not sure why it did that.


There was some set of Apple Input support extensions around MacOS 7/8 that I remember using with it but can't google for the life of me atm. Provided gamepad support and other input niceties. I'm guessing constant polling across 4 devices impacted the tick rate of the graphics engine in Escape Velocity's case.



Exactly what I was thinking of! Between that, CodeWarrior, and Ingemar Ragnemalm's Sprite Animation Toolkit (SAT), you had the basic tool-chain for development of a huge amount of early PPC Shareware gaming. Halcyon days.


I picked up an Ortek ADB keyboard a few months back - clearly an imitation of the AEK-II (but interestingly it seems to have a PBT spacebar - the AEK-II has ABS spacebar but PBT for all the other keys, so by now an AEK-II's spacebar will typically be yellower than its neighbours)

I wired up a similar adapter using a 5v ProMicro, and used the older TMK firmware, which works a treat.


As far as I can see the QMK and TMK firmware for the ADB/USB are identical - seems the two projects have an amicable relationship. If I understood it right the QMK fork is mostly around including alternate mappings as part of the repo.

I did find the python tool in QMK very helpful for getting the binary burned into the Atmega though; I'm not sure it would have been as smooth sailing with TMK.


I don't remember how I uploaded the binary into the chip now - I might have used avrdude but I couldn't swear to it. But either way I don't remember it being much of an ordeal.

(In the past I've tended to shy away from python-based tooling - I don't know enough about the language or its infrastructure to interpret the error messages when a jenga tower of code and dependencies falls over with messages about wheels or somesuch. I'm too old to have much patience with that kind of side-quest! I'm sure it's all a lot more mature and dependable these days, though.)


I had a play with this stuff a while ago and I killed an Atmega in the process - I suspect by burning a binary for a different chip into it. I think that was with avrdude - a combination of winging it cluelessly and the Atmega board I was using not exposing the necessary pins to force burn a new binary. The one I use in this project was chosen specifically because it had the programming pins available.

Normally I shy away from python/node/perl/intercal tooling much as you describe, but it was very painless. I was mostly expecting to document "giving up and figuring out how I should actually be using avrdude in preference to understanding someone else's language's error and/or config messages" but tripped over a stair that wasn't there when it just worked from the outset.

Discounting the bit where I tried to use a borked USB cable that is...


Damn. I never knew I needed a pre-ADB Mac M0001/512K/512Ke/Plus keyboard + mouse to USB adapter until just now…


Thanks I am mid process of adding adb for qmk. Pretty much the reverse of this article.

The qmk discord mentioned they had no interest in taking this patchset so I imagine I will be doing this for a once off. Thank you for the resources.


Actually I use the same hardware setup (ADB->USB) and the same keyboard, just with a different adapter, so I'd be happy with any patch to QMK. That makes at least 2 of us ;-)


I will link you up when I have something working.


So - you are working on USB device (keyboard/mouse) to ADB host? I would also like that if so.


Oh - I thought this was for using USB devices on the ADB Mac, not the other way around.

There are options for using modern USB devices on ADB as well, such as the ADBuino (https://github.com/akuker/adbuino) and my fork called HIDHopper (https://github.com/TechByAndroda/HIDHopper_ADB).


Hah - I recently built a USB - ADB adapter around a RISC-V MCU (CH32X035) in Rust. The design of the 'rtos' borrows quite a bit from Oxide's Hubris, but I haven't spent much time implementing supervisor functionality, memory protection works though.

One thing that's nice about the CH32X035 is that it can run at 5V so it's trivial to interface over ADB - you just need the pull-up. It has some internal level translation for the USB data pins.


> the downside is that I’m obliged to work on a Mac. I kind of hate Macs. Not quite as bad as Windows, but damn I’m missing Linux in the workplace.

I got around this by running an Ubuntu VM on Parallels. I ssh in using VSCode and configured Parallels to forward application ports to the Mac side, so I can hit the web apps we build using Chrome on the Mac side.


Sadly there's some very intrusive corporate DLP borderline-malware that we're obliged to run, so this wouldn't fly. It makes me sigh a lot, but the rest of the job is a lot of fun so I put up with it.


I hear good things about TinkerBoy’s adapter – it even supports QMK and Via: https://www.tinkerboy.xyz/product/tinkerboy-adb-to-usb-keybo...


I use the Wombat[0] with wireless Logitech MX desktop on my Quadra and it works wonderfully. Key mappings can also be fully customized if needed.

[0] https://www.bigmessowires.com/usb-wombat/


I have a Wombat or two and can recommend them highly. Go Steve! Also, the Wombat goes both directions (to use an ADB keyboard on a modern USB machine, OR to use a modern USB keyboard on an ADB Mac/Apple IIgs/Next).


It's good. I was using it for a while but an unfortunate power surge through my KVM burned it. It's made really well though.


You can also buy these "off the shelf" from https://www.drakware.com/ . My wife uses a NeXT keyboard (which she's been using for 25 years!) via one of their adapters.


Ah, apple keyboards and ADB.

I worked in a lab full of Mac II, IIc, and similar vintage computers. The irritating placement of the home key nubs drove me nuts -- I eventually vandalized all the keyboards by shaving off the nubs on D and K and putting marks on F and J.

The lab networked all the computers together to the laser printer using whatever that ADB networking gizmo was, which was super neat -- no other computer in the lab had networking; a couple of the PCs had serial connections to terminal servers.


Was that the old school AppleTalk network? I remember we had some Mac Plus's in the lab at my middle school. They were all decked out completely though. I think they even had external 1GB hard drives on them. Plus they used that ADB networking connector, so we could transfer files between them and a file server.


A little poking around -- perhaps the ADB and appletalk ports are different. It's been a while.

The macs in the labs were amazing compared to the PCs. The difference between a IIcx and some random 286 of roughly the same vintage.


I'm typing this on a ProtoArc Bluetooth keyboard. Occasionally the Mac loses the connection, but I've learned how to get it back quickly.

I'm not going to disparage wired keyboards, but it IS handy to have wireless. I've also learned to always keep them close together, so the connection doesn't get dropped.


Kool project! Well done :) ..I feel for you having to ditsh Linux for Mac, don't think I could ever do that




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: