PC Keyboard: The First Five Years

The vast majority of PC users today have no memory of what PC keyboards looked like before the standard 101/102-key layout arrived, even though various OEMs do their best to mangle the standard layout in order to minimize usability, especially on laptops. OEM-specific modifications aside, the basic layout of the main block of alphanumeric keys has not changed in over 30 years, since 1986.

However, up until that point the PC keyboard layout and the keyboard hardware changed quite a bit, and looking at the 1981-1986 IBM Technical References is key to understanding a) why the standard keyboard scan codes are so complex, and b) why there are so many seemingly odd vendor-specific modifications of the standard layout.

83-key Layout, 1981

All keyboard diagrams were borrowed from IBM Technical References. The original PC keyboard (1981) looked like this:

Original 83-key PC keyboard, 1981

From today’s perspective, that keyboard looks rather strange for a number of reasons.

The Enter key is big on the US keyboard, the Esc key is in an odd place, the Ctrl key is where Caps Lock is now and Caps Lock is where the right Ctrl key is now, there’s just one Alt and one Ctrl key, the PrtSc key is jammed in a weird space under the Enter key, and the numeric block is barely recognizable as well.

That the function keys (only F1-F10) are organized in two columns on the left is a comparatively minor difference.

On a technical level, it is important to understand one basic but perhaps non-obvious fact: The keys have numbers corresponding to their location on the keyboard. The behavior of all keys (i.e. what data they send when pressed/released) is purely a function of their number. It has absolutely nothing to do with the labels on the key tops—that’s strictly cosmetic.

84-key Layout, 1984

When the IBM PC/AT came out in 1984, it sported a new and different keyboard. At first glance, the keyboard looked just like the original PC keyboard with function keys on the left; the biggest visual difference was that there was now a clear separation between the main alphanumeric block and the numeric block:

Updated 84-key PC/AT keyboard, 1984

But on closer look, there were very substantial changes. For one thing, the Esc key moved to a totally different place, and it now lived in the upper left corner of the numeric block. The backslash key moved from next to the left Shift to the other corner, next to the Backspace key. The Enter key changed shape and forced the backtick (`) key to move where Esc used to live. The new 84th key was SysRq (System Request), never used much at all.

A significant difference not apparent from the above diagram is that the AT keyboard has three LED indicators. These show the current state of Caps Lock, Num Lock, and Scroll Lock. Another new feature not visible in diagrams is typematic control: The AT keyboard has programmable delay and repeat rate for keys held down for a longer period of time.

To that end, the AT keyboard provides bidirectional communication between the host (keyboard controller) and the keyboard itself. Note that the LEDs are fully under the control of the host system, and it is only a convention that they show the lock states. The system BIOS normally manages the LED state, or an OS does.

There was another technical change: For reasons that are not entirely obvious, the AT keyboard sends quite different scan codes compared to the original PC keyboard. The keyboard controller on the system motherboard translates the scan codes from the keyboard into scan PC-compatible scan codes, such that software written to deal with PC (and XT) scan codes continues to work on ATs.

There are echoes of the 84-key AT layout which can be found on various OEM keyboards. There are 102-key keyboards with AT-style Enter and small Backspace, for example.

Enhanced 101/102-key Layout, 1986

In 1986, IBM finally arrived at the “enhanced” keyboard layout everyone knows:

Enhanced 101-key US layout

There was a slew of changes from the previous 84-key AT layout: The function keys were moved from the left to the top, with F11 and F12 added. Completely new “gray” cursor and movement keys were added between the main alphanumeric block and the numeric block. Because the function keys were relocated, the overall size of the keyboard did not significantly change.

The Esc key moved to the upper left corner, similar to where it was on the original PC keyboard. Caps Lock moved under the Tab key, and Ctrl and Alt keys now both came in left and right variants.

On the 101-key US layout, the Enter key lost weight; the backslash key moved to where the top part of the fat Enter used to be, making room for a double-sized Backspace key.

The non-US 102-key layouts were very similar; this is for example the UK layout:

Enhanced 102-key UK layout

The differences are best described using the key position numbers (click on images to see larger size versions). Enter is still key number 43; key 29 (backslash) is gone, but effectively reappears nearby as key 42 above the right Shift key, with the same scan code. Key 45 (to the right of the smaller left Shift key) is the additional 102nd key.

The Enhanced keyboard has several non-obvious new features. It supports a new Read ID command (0F2h) which can be used by software to identify it. It also supports two additional sets of scan codes. The AT keyboard set is called Scan Set 2, the original PC set is Scan Set 1, and there is a new, much simpler and more straightforward Scan Set 3. Unfortunately this change came too late and Scan Set 1 is next to useless because the keyboard controller achieves the same thing, and the significantly more sane Scan Set 3 was never widely used by operating systems because many clone keyboards do not support it (Solaris 8 is one of the very few OSes attempting to use it).

The gray keys (arrows, Ins, Del, Home, End, Page Up, Page Down) behave in quite non-obvious manner. On the 83- and 84-key keyboards, the Num Lock key is the only option for switching between numeric input and cursor keys. On the Enhanced keyboard, Num Lock is much less important because standalone cursor keys are always available. However, for compatibility with the older keyboards, the gray keys send different scan codes depending on the state of Num Lock and Shift keys; this simulates the keys on the numeric block.

The Enhanced keyboard uses an extra byte (E0h) with some of the additional keys (gray keys, added Ctrl and Alt keys). The E0h code is ignored by old software, so only one Alt or Ctrl is still seen, but new software can use the extra code to distinguish the right and left Alt and Ctrl keys.

PS/2 Keyboard, 1987

The only real difference between the Enhanced AT keyboards and PS/2 keyboards is the connector size. AT keyboards use a 5-pin DIN connectors, while PS/2 keyboards switched to the smaller mini-DIN connector. On the electrical and functional levels there are no differences, which is why a simple mechanical adapter suffices to convert an AT keyboard to a PS/2 keyboard or vice versa.

Note: Thanks go to the generous folks who published scans of the various IBM Technical References. Having these documents publicly available has been very, very helpful.

This entry was posted in IBM, Keyboard, PC hardware, PC history. Bookmark the permalink.

19 Responses to PC Keyboard: The First Five Years

  1. John Elliott says:

    You skipped over the 122-key keyboard on the 3270PC, which I think is a pity, because meseems that’s where a lot of the new features in the AT keyboard originated: the bidirectional protocol, the different scancode set, the Read ID command[1] and even the controller design. They’re sufficiently similar that it’s possible to put the 8048 from an AT keyboard into a 3270PC keyboard and you get a 122-key AT keyboard.

    It’s also my opinion that the AT keyboard is using Set 3 rather than Set 2 – that’s certainly the case for the extra key positions under its double-size keycaps.

    [1] Though on the 3270PC keyboard, it reads the DIP switches rather than returning a fixed ID.

  2. zeurkous says:

    Yeah, let’s have a read about that sucker! 🙂 Certainly an interesting
    episode, that weird hybrid. Or is Necasek planning a separate article?

    *scratches head* Is that the kbd where the F{13..24} keys originated?

  3. Michal Necasek says:

    Simple reason, I’ve never seen a 3270PC or a 122-key keyboard. I should probably check my old PC Tech Journal issues to see what they wrote back then. It does sound like an important evolutionary step but I don’t think it ever sold in big numbers or spawned a lot of clones. It’s a similar category to the IBM PC precursors, important in the PC evolution but not significant by themselves.

    I believe Scan Set 2 is the default on the Enhanced keyboard precisely because it’s compatible with the 84-key AT keyboard.

    And yes, F13-F22 keys could be found on the 122-key keyboards.

  4. John Elliott says:

    I wrote up the 3270PC keyboard at http://www.seasip.info/VintagePC/ibm_6110344.html .

    My views on why the AT keyboard can be said to use Set 3 rather than Set 2 are at http://www.seasip.info/VintagePC/ibmat_kbc.html . I think what prompted the creation of Set 2 is that Set 3 has separate codes for ‘function keys at the left’ and ‘function keys at the top’ (05 = Left F1, 07 = Top F1). Set 2 makes the ‘top’ function keys return the scancodes for the ‘left’ function keys.

  5. Michal Necasek says:

    I see what you’re saying about Set 3. It’s the straightforward extension of the 84-key AT keyboard scan code set, whereas Set 2 is a complex backward compatible creation.

    The fact that the older 122-key keyboard also uses Set 3 is a good argument.

  6. Michal Necasek says:

    Is there a 3270 PC Technical Reference? There’s some documentation on bitsavers but I can’t find anything like the PC/XT/AT Tech Ref.

    Though there might be just enough information about the keyboard layout in the available documents already.

  7. John Elliott says:

    If there is a 3270PC Technical Reference, I’ve never seen it. I presume there must have been some sort of documentation, because Digital Research wrote GEM drivers for it, but even they only interface with the BIOS rather than manipulating the hardware directly.

    Looking for documentation for the 3179 / 3197 terminals might be another line of enquiry, since they have 122-key keyboards of similar appearance.

  8. Michal Necasek says:

    I did not see a Technical Reference mentioned either in the 3270 PC announcements or in the other manuals, which makes me think it does not exist.

  9. Richard Wells says:

    The 3270-PC did have a Service Manual in the announcements which may have the information needed. I haven’t found one though. Different parts of IBM had different naming standards.

    The System 23 Service Library Volume 1 covers the original parallel Model F keyboard in detail. See Chapter 3.

  10. Michal Necasek says:

    I found the layout documented here: http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/3270/SA23-0343-0_3270_Workstation_Program_Programming_Guide_Apr87.pdf (at the very end of the document). The Service Manual does have some good hints about the 3270 PC hardware but it’s not a Tech Ref.

  11. John Elliott says:

    The list of publications at http://bitsavers.trailing-edge.com/pdf/ibm/pc/IBM_Personal_System_2_and_IBM_Personal_Computer_Publication_Reference_Jan89.pdf lists technical reference manuals for the PC, XT and AT, but I don’t see one for the 3270PC – either under “System Technical Reference” or “3270-PC Family”.

  12. John Elliott says:

    It does mention a “3270-PC Hardware Reference” (GA23-0233) which may be relevant, though googling that serial number also finds it named as “IBM 3270 PC Hardware Problem Determination”, which sounds less hopeful.

  13. dmjb says:

    Perhaps worth pointing out that the PC keyboard was the same keyboard (but with different functional layout) as the slightly earlier System/23 Datamaster, and in turn was based on the layout of the IBM 5251 terminal keyboard. There’s only one small difference between the PC/Datamaster layout and the 5251, and indeed the 5251’s successor, the 5291, used the same basic PC/Datamaster design.

    The AT keyboard is somewhat similar to the 92-key Displaywriter keyboard (not to be confused with the more common 96-key model) – the main difference being that the Displaywriter did not have a numeric keypad, but rather two rows of editing keys.

  14. Michal Necasek says:

    That’s what I deliberately didn’t get into, but it’s still interesting to know. Thanks!

  15. Richard Wells says:

    The initial design being the same as the System/23 with only a few keycaps probably should have been mentioned because many of the complaints about the keyboard layout could not be resolved without more extensive redesigning.

    Switching to serial interface is rather necessary to have a movable cable.

    The other influence on the IBM PC keyboard layout seems to be the VT 100 line of keyboards with to the left of the number 1 and to the left of “A.” Wasn’t a complete copy of the VT since VT had both CRTL and Caps Lock to the left of the “A”* and the oversized Enter key wasn’t adopted until the revised keyboard which also placed the backslash/pipe key on the right but not to the right of the Enter key like the VT. Unfortunately, Esc got shoved away or the IBM AT keyboard would have been perfect for VT-100 emulation.

    * Which meant the wrong key got hit way too often.

    Creating a modifier cluster in the enhanced keyboard was a great improvement. Once pressing SHIFT plus Control or Alt and some other key became common, that made it easy to hit two keys with one hand while the second hand sought out the needed third key. Using later versions of Wordperfect with the original Model F keyboard was like playing a version of Twister. It also protected against accidentally mashing both Control and a function key avoiding the CUA window altering commands.

  16. MiaM says:

    It’s worth mentioning that at some point in the evolution of the keyboard layout driver in DOS support for non-enhanced keyboards were silently dropped. Not sure when this happend, but the end result is that when you use a Swedish keymap on a non-enhanced keyboard it’s impossible to type for example backslash without using the ALT+92 trick 🙁

    It would be really nice if someone would take the time to test which DOS versions that has this behavious, and also test if pressing ALT+CTRL at the same time really works as pressing AltGr or if you really need to have that specific AltGr key.

  17. MiaM says:

    P.S. is the UK keyboard the only non-US keyboard that doesn’t have symbols mapped to the AltGr key?

    With the Swedish/Finninsh layout, still in use today, you have to use AltGr to type any of the chars |@£$‰{[]}\~¬ (and all letters combined with a ~, like for example ñ)

    Side track onm this side track: The various national layouts can really f**ck up emulation of other vintage computers, which were available with national keyboards but with different layouts than what a PC had. If the emulator isn’t aware of this, it tries to translate a key press as a scan code to what it thinks is the corresponding key on the emulated machine, except that it ends up being the wrong key or the wrong shift state when the layout’s doesent match. About every time I try to use the VICE emulator to emulate 8-bit commodore computers I end up just pressing keys more or less randomly until I find which key generates the char I want to type. 🙁

  18. Retron says:

    ” is the UK keyboard the only non-US keyboard that doesn’t have symbols mapped to the AltGr key?”

    The UK keyboard actually has a few:

    ¦ is generated by pressing AltGr and `, as opposed to the more usual | from pressing Shift and \. It’s been marked on keyboards for a long time now.

    € is a more recent addition: AltGr+4, chosen, I suspect, as Shift+4 is $.

    And then, albeit undocumented, AltGr+a, e, i, o and u gives those characters with an acute accent, i.e. é.

  19. dmjb says:

    > Switching to serial interface is rather necessary to have a movable cable.

    Many of IBM’s terminals had parallel interfaces with moveable cables. There was also a ‘desktop’ model of the S/23 which had a standalone keyboard with a parallel interface.

    I suspect the change to serial was for cost reasons.

Leave a Reply

Your email address will not be published. Required fields are marked *

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