Reverse Engineering The NeXT Computer Keyboard Protocol

The NeXT computer was introduced in 1988, with the high-end machine finding favor with universities and financial institutions during its short time in the marketplace. [Spencer Nelson] came across a keyboard from one of these machines, and with little experience, set about figuring out how it worked.

The keyboard features a type of DIN connector and speaks a non-ADB protocol to the machine, but [Spencer] wanted to get it speaking USB for use with modern computers. First attempts at using pre-baked software found online to get the keyboard working proved to be unreliable. [Spencer] suspected that the code, designed to read 50 microsecond pulses from the keyboard, was miscalibrated.

Some analysis with an oscilloscope and logic analyzer allowed [Spencer] to figure out the keyboard was communicating with pulses ever 52.74 microseconds, corresponding to a frequency of 18.960 kHz, sending two 9-bit messages at a time. Disassembling the keyboard confirmed these findings – inside was a 455 kHz clock, with the keyboard sending a signal every 24 ticks producing the 18.960 kHz output.

Reworking the initial code found online to work with the actual pulse widths coming from the keyboard got everything humming along nicely. Now, [Spencer] has a nice vintage keyboard with excellent feel that reliably works with modern hardware. We’d call that a win.

If you need more of a fix, be sure to dive into Keebin’ with Kristina, a regular column all about our favorite tactile input devices!

22 thoughts on “Reverse Engineering The NeXT Computer Keyboard Protocol

  1. There was also a very nice Apple Desktop Bus (ADB) keyboard. very sleek and the ctrl knob was actually a ctrl bar under the space bar in the rim of the keyboard itself. This was for the last incarnation of the “black hardware” ie the computers designed by NeXT computers themselves before they became a software only company and later on bought up by Apple .

    https://deskthority.net/wiki/NeXT_ADB

  2. Kudos for the reverse engineering, but *needing* to do this kind of thing always infuriates me.

    What did they possibly gain by using their own _keyboard protocol_ !?

    That is, aside from locking the user into buying replacement parts from only NeXT, but as I recall, the NeXT machines were manifestly *not* inexpensive machines, so doing this just to force the sale of their own keyboards seems too petty to be the driving reason.

    Steve Jobs accomplished a lot, but way too often he sailed far past the point of “Hey – this is a practical solution, we should stop here” .

    1. What else would they have done?

      There wasn’t anything like a standard for keyboards at the time. There were many different makers of personal computers and workstations, and *everyone* had their own keyboard and mouse, just like everyone had proprietary joystick ports, monitors, expansion slots and software.

      This protocol was maybe designed as early as 1986. ADB came out late that year. PS/2 came out six months after in 1987 and it took years even for PC makers to make the move to that. The old AT ports were common well into the 1990’s. It was not at all obvious at the time that PC hardware would take the place it did, so using an AT keyboard was no more obvious than using, say, a DEC terminal keyboard or Apple’s ADB – which NeXT actually did switch to for their later models.

      Also, note how the keyboard has a power button above the arrow key. The NeXT machine had soft power from the keyboard, which requires a dedicated pin that the AT ports just didn’t have. The Macintosh II (1986) was AFAIK the first machine with soft power like this, but it is a contemporary of the NeXT machine.

      1. There wasn’t real standardization before, except ascii keybiards with the encoder on board.

        About 1995, I fiund an HP-150, and hauled it home. From 1984, it was a different branch, a touch screen. Otherwise, rather like the Mac, CRT and CPU in one box.

        It seemed to work, but I never had a keyboard for it. A telephone connector, but I could never find details. I couldn’t assume some other keyboard would happen to work.

    1. Decades? Sure. It was a lot of days ago too. But these are the 2020s now. I think we can say century at this point can’t we? I have a radio in my house with a 455kHz IF that will be hitting 100 years old soon. I should go check the year when I get home. I wonder if it’s there yet. Definitely this decade.

      So… raise your hand if you read that and started feeling old. Anyone?

  3. Kudos to Spencer for his blog article that was not only fascinating in a technical sense but also beautifully and succinctly written. I know I would have opened the keyboard up long before he did, to see whether looking at the components would hold some clues to interpreting the signal.
    Well done, thanks for the interesting read!

  4. What was up with Jobs’s peculiar refusal to put a real Delete key on keyboards? This big-ass keyboard still doesn’t have Delete; it has only a Backspace key mislabeled “delete.”

    To this day Apple perpetuates this stupidity on most of its keyboards, despite everyone else having figured out how to put a Delete key on even small ones. If nothing else, the obsolescence of the Eject key provided a perfect opportunity to address this flaw. But nope… Apple pettily refused to do it even then. WTF?

    1. Because you only need one key, and having “backspace” and “delete” is an extravagance.

      Next you’ll be claiming it’s necessary to have more than one button on a mouse!

      1. Well, they gave up on that one! Eventually Apple went off the rails in the other direction, making the surface of the mouse a trackpad. Of course, that’s equally dumb… you’re supposed to somehow hold the mouse still with some fingers, but do a multi-fingered sideways swipe with others. I hear Dr. Octopus loves it though.

    2. When will someone redesign the antiquated keyboard ? Many of the keys come from the dawn of computers. Nearly a 1/3 of the keys are never used except by programmers/hardcore users. If you were to redesign the keyboard, what keys would you lose ? What would you want in the recovered real estate ?

      1. The only change I want is a compose key that I don’t have to give up some other key to get and I want it in a position that heavy use doesn’t make my hand hurt. I don’t want a cut-down keyboard as I use almost all the keys. I guess that might in some people’s eyes make me some sort of hard-core something but when common keyboards lose a bunch of keys all those regular users won’t really be helped by that and I’ll have to spend a bunch of money to buy a specialty keyboard. Don’t make me do that!

        For now I have the right “winkey” and menu button set to be the compose key. I did both because I found it hard to hit just one of them reliably while typing without moving away from home. That’s an ok solution but it would be nice if it could be squeezed in somewhere easily accessible from home row.

        The only keys I don’t really use are the upper right ones, prtscn/sysrq, scroll lock and pause/break. In the past I tried making pause/break my compose key but my hand got really sore so giving those up to get my compose key wouldn’t be much of a help. Also, since I recently watched a video that explained what scroll lock is actually supposed to do I might start using it.

      2. Even if no single person uses more than 60% of the keys, exactly WHICH 60% they use will be different for each person. So we end up with 104 keys, which is enough for most people. Personally, I am happy to lug around a bigger laptop, if it has a proper number pad…

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.