30

On a US-layout PC keyboard, the symbols above the number keys are as follows: Keyboard with '!' above '1' and ')' above '0'

Whereas the keyboard on an Apple II is different: Keyboard with '!' above '1', but ')' above '9' Note, for example, the '(' and ')' symbols are now above 8 and 9, and '&' is above 6 instead of 7.

The order of the symbols on the Apple II corresponds to the ASCII symbols 33 to 41, in that order. This layout was used on a number of other microcomputers (including the Commodore 64 and the BBC Micro), and dated back at least to the 1970s: in 1974 Popular Electronics ran an article on how to build your own ASCII keyboard.

Despite this, IBM chose to use a non-ASCII-based layout for their keyboard. Apple later abandoned the ASCII layout for the Macintosh in 1984, adopting a similar layout to IBM's PC.

Obviously with the growth of the PC clone market, the PC layout would become a de-facto standard, and ASCII keyboards were relegated to history. But why were there two different layouts in the first place?

Note that the "PC" layout for the symbols was not a novel invention by IBM for it's PC: it had already been seen on the Space-cadet keyboard, VT100 terminal, and the Xerox Alto. The point remains that there were two different layouts in use at the same time.

  • There are numerous keyboard layouts. Most require characters outside the 7-bit ASCII range. – Thorbjørn Ravn Andersen Feb 8 at 17:09
  • @Kaz It's worse than that, actually. In England we have a different set of symbols, not wildly dissimilar to the US ones but 2 of the symbols are different (above the 2 and the 3), and the omitted symbols are squeezed in elsewhere. But I've used lots of PC's here over the years, mainly from Japanese or US manufacturers, and rarely are the keyboards identical (except the qwerty-based alphabet arrangement). Beware of buying one in Germany -- you can come across a lot of local variations! – Ed999 Feb 10 at 10:12
  • 1
    @Ed999 I'm actually in the UK, but chose to write the question from a US point of view, to avoid any misunderstandings about "it's because you're using a keyboard from a different region" in the answers. – Kaz Feb 10 at 10:18
48

It all dates back to typewriters, but the two layouts aren’t ASCII v. non-ASCII, they’re mechanical v. electric.

The !" etc. layout was common on mechanical typewriters, based on the layout used for the Remington No. 2 in 1878. This is the layout that ASCII was based on; that’s why “!”, “"” etc. received consecutive encodings, aligned with the encodings of the digits they were paired with. This was criterion 17 in the ASCII committee’s decision-making process (see Charles E. Mackenzie’s Coded Character Sets, History and Development for details):

Criterion 17. Graphics that are normally paired on typewriter keytops should differ only in a common single bit position.

This also explains the paired encodings of the other symbols in the 33-63 range (“*”/“:”, “+”/“;” etc.). Criterion 14 determined the space character’s encoding and caused some shifting of characters to free up 0 (space is the “shifted” character corresponding to 0).

With the advent of electric typewriters (not electronic, yet), the designers ran into issues with the force required for different symbols. Smaller symbols such as ' and " require less force; having them on the same keys as digits meant that the drivers had to be more complex. (You can see the different force requirement on a mechanical typewriter: if you hit ' or . with the same force as a letter key, you’ll often end up with an imprint of the type element on the paper, showing as a rectangle around the symbol.) To simplify the design, small symbols were grouped together on separate keys, so that the force didn’t vary for a single key’s different symbols. This layout ended up being used in IBM’s Selectric range in particular, and IBM continued using that layout for its computer keyboards (which pre-date the PC).

Ultimately the PC won in the market, and its keyboard layout along with it.

  • 2
    Perfect explanation of the whereabout, except for the introduction. I wouldn't call it 'not about ASCII vs. non ASCII', but an ASCII compatible ordering sequence, like the Apple used to need only a simple encoder vs. the PC mimicking the Selectric keyboard. So ASCII did play a role here. It may, BTW, be remarkable that the sequence on a German PC keyboard is the same as with mechanical typewriters (ASCII) except 3 carries § and 7 has /. again, like German typewriters before. Fliping all the symbols above the numbers makes using US keyboards for me harder than the simple Y/Z switch. – Raffzahn Feb 8 at 17:27
  • 1
    Though of course the layout used on current computers depends on the language/region. For example, the layout common in the nordic countries is similar to that Apple II keyboard in that the symbols mentioned in the question, &, ( and ), are above 6, 8 and 9. Some others are in different places, though... – ilkkachu Feb 9 at 10:31
9

It all dates back to the age of typewriters.

Using an ASCII-based layout made the design of computer keyboard encoders simpler, as the output of any key while holding Shift (capitals, symbols) differs from the the normal output by just one bit. For this reason, these keyboards are also known as bit-paired keyboards.

Mechanical typewriters had used a large number of different layouts, particularly early designs. A standardised layout had developed by the time of IBM's Selectric electric typewriter in the 1960s. This standard typewriter layout differed from the bit-paired ASCII layout, particularly in its placement of symbols, but this was not a disadvantage for a typewriter.

In the computer age, these two layouts would appeal to different types of individuals. Computer designers and engineers would obviously appreciate the simplicity of the ASCII-based layout when building a machine. On the other hand, many computers were used by professional typists as a replacement for electric typewriters. As users of touch-typing, they would want to keep the same keyboard layout they were used to, as switching layout would slow down their work.

In the light of this, it's unsurprising that IBM would use the same typewriter-based layout as their Selectrics when releasing their first personal computer. It is possible that Apple changed layout for the Mac for the same reason.

  • I'd written the whole question, and was getting sources for the last paragraph, when I first stumbled across the term "bit-shifted keyboard", which immediately gave me the explanation. I figured I may as well write up an answer and share it. Strange that I'd never come across the term before... – Kaz Feb 8 at 15:23
  • Note that the order of symbols in ASCII is itself based on the common American layout used on mechanical typewriters. When ASCII was developed, there were two common layouts, one for mechanical typewriters, the other for electric typewriters, and those are the two layouts in your question. – Stephen Kitt Feb 8 at 15:46
  • @StephenKitt Would it be more accurate to say ASCII was based on electric teleprinters, rather than mechanical typewriters? – Kaz Feb 8 at 15:50
  • 1
    @ and " are swapped between the UK and USA Windows keyboard layouts. There are other changes as well, since shift-3 is used for the UK pound currency sign, not the US "pound/hash" sign. But I have no idea why @ and " were swapped between the UK and US layouts. – alephzero Feb 8 at 15:56
  • @alephzero I wasn't thinking so much of regional differences, rather the fact that there were different layouts for the same region: the changing position of the '(' and ')' for example. Incidentally, the UK-based BBC Micro kept the same ASCII layout on the number keys as the Apple II pictured with '#' symbol as shift-3, and allocated '£' to code 0x60, placed on a key to the left of the cursor keys. So there's the same mismatch between an ASCII layout and a UK/GB PC keyboard layout. – Kaz Feb 8 at 16:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.