One of the most ubiquitous techniques for interactively entering data into a computer is by means of a typewriter-style keyboard. When we actually come to consider it, however, the layout of the keys seems somewhat less that intuitive, so where did the computer keyboard come from and how did it evolve into the little scamp we know and love today…...

View Topics



 
Introduction
Although the fingers of an expert typist leap from key to key with the agility of a mountain goat and the dexterity of a concert pianist, newcomers to the computer keyboard usually spend the vast bulk of their time desperately trying to locate the next key they wish to press.

It is actually not uncommon for strong words to ensue describing the way in which the keys are laid out, including the assertion that whoever came up with the scheme we employ must have been a blithering idiot. So why is it that a device we use so much is constructed in such a way that anyone who lays their hands on one is immediately reduced to uttering expletives and banging their heads against the nearest wall? Ah, there’s the question and, as with so many things, the answer is shrouded in the mists of time...




 
Why is a Typewriter like a Sewing Machine?
The first references to what we would call a typewriter are buried in the records of the British patent office. In 1714, by the grace of Queen Anne, a patent was granted to the English engineer Henry Mill. In a brave attempt towards the longest sentence in the English language with the minimum use of punctuation, the wording of this patent’s title was: “An artificial machine or method for the impressing or transcribing of letters singly or progressively one after another, as in writing, whereby all writing whatever may be engrossed in paper or parchment so neat and exact as not to be distinguished from print.” Unfortunately, after all the labors of the long-suffering patent clerk (a man who could have benefited from access to a typewriter if ever there was one), Mill never got around to actually manufacturing his machine.

Following a few sporadic attempts from different parts of the globe, the first American patent for a typewriter was granted in 1829 to William A ustin Burt from Detroit. However, the path of the inventor is rarely a smooth one as Burt was to discover. We may only picture the scene in the patent office:

  Clark: “Hello there, Mr. Burt, I have both good news and bad news. Which would you like first sir?”
  Burt: “I think I’ll take the good news, if it’s all the same to you.”
  Clark: “Well, the good news is that you’ve been granted a patent for the device which you are pleased to call your Typographer.”
  Burt: “Good grief, I’m tickled pink, so what’s the bad news?”
  Clark: “Sad to relate, the only existing model of your machine was destroyed in a fire at our Washington patent office!”

To be perfectly honest, the patent office (along with the Typographer) burned down in 1836; seven years after Burt received his patent. But as we all learn at our mother’s knee, one should never allow awkward facts to get in the way of a good story.

As fate would have it, the fire probably caused no great loss to civilization as we know it. Burt’s first Typographer was notably ungainly, so much so that it was possible to write much faster than one could type with this device. Undaunted, Burt produced a second model the size of a present-day pinball machine, which, if nothing else, would have made an interesting conversation piece if given to a friend as a Christmas stocking-filler. Perhaps not surprisingly, no one was interested, and Burt eventually exited the stage to make room for younger contenders.

Following Burt, numerous other innovators leapt into the fray with truly “Heath Robinson” offerings. Some of these weird and wonderful contraptions were as difficult to use as a Church organ, while others printed by keeping the paper stationary and hurling the rest of the machine against it – the mind boggles.

The first practical machine was conceived by three American inventors and friends who spent their evenings tinkering together. In 1867, Christopher Latham Sholes, Carlos Glidden, and Samual W. Soulé invented what they called the Type-Writer (the hyphen was discarded some years later). Soulé eventually dropped out, but the others kept at it, producing close to thirty experimental models over the next five years. Unfortunately, Sholes and Glidden never really capitalized on their invention, but instead sold the rights to a smooth-talking entrepreneur called James Densmore, who, in 1873, entered into a contract with a gun and sewing machine manufacturer to produce the device.

Strangely, the manufacturers, E. Remington and Sons from the state of New York, had no experience building typewriters. This was primarily because no one had ever produced a typewriter before, but there’s also the fact that (let’s face it) Remington and Sons made guns and sewing machines. The first thing they did was to hunt for the best artist-mechanic they could find, and they eventually settled on William K. Jenne. However, Jenne’s expertise was in the design of sewing machines, with the result that the world’s first commercial typewriter, released in 1874, ended up with a foot pedal to advance the paper and sweet little flowers on the sides!




 
The Sholes (QWERTY) Keyboard
It is commonly believed that the original layout of keys on a typewriter was intended to slow the typist down, but this isn’t strictly true. Sholes and Glidden obviously wished to make their typewriters as fast as possible in order to convince people to use them. However, one problem with the first machines was that the keys (or rather, the hammer bars used to strike the paper) jammed when the operator typed at any real speed, so Sholes invented what was to become known as the Sholes keyboard:

Sholes (QWERTY) Keyboard

As we see, the top row of keys was used for numbers, while the bottom three rows were used for the alpha characters (the blank keys in this illustration were used for punctuation and special characters). So why did Sholes decide upon this particular layout of the keys? Well, the term digraph refers to combinations of two letters that represent a single sound, such as “sh” in “ship,” where these letters are frequently written or typed one after the other. What Sholes attempted to do was to separate the letters of as many common digraphs as possible so as to prevent the keys from jamming. But in addition to being a pain to use, the resulting layout also left something to be desired on the digraph front; for example, “ed”, “er”, “th”, and “tr” all use keys that are close to each other.

Happily, the jamming problem was eventually overcome by the use of springs that were used to quickly return the keys (hammer bars) to their initial positions, but the monster had been let loose amongst us – existing users didn’t want to change and there was no turning back.

The original Sholes keyboard (which is known to us as the QWERTY Keyboard, because of the ordering of the first six keys in the upper alpha-character row) is interesting for at least two other reasons: first, there was no key for the number ‘1’, because the inventors decided that the users could get by with the letter ‘I’; and second, there was no shift key, because the first typewriters could only type uppercase letters. The first shift-key typewriter (in which uppercase and lowercase letters are made available on the same key) didn’t appear on the market until 1878, and it was quickly challenged by another flavor which contained twice the number of keys, one for every uppercase and lowercase character. For quite some time these two alternatives vied for the hearts and minds of the typing fraternity, but the advent of a technique known as touch-typing favored the shift-key solution, which thereafter reigned supreme.

Speaking of touch-typing, the illustration of the Sholes keyboard above shows the ‘A’, ‘S’, ‘D’, and ‘F’ keys in white to indicate that these are the home keys for the left hand. Similarly, the other four keys shown in white are the home keys for the right hand. The terms home keys and home row refer to the base position for your fingers (excluding thumbs, which are used to hit the space bar) when you’re practicing touch typing, which means that you type by touch without looking at the keyboard.

However, Sholes didn’t invent these terms, because he actually gave very little thought to the way in which people would use his invention. The end result was that everyone was left to their own devices, effectively meaning that two-fingered typists using the “hunt-and-peck” method ruled the world. It was not until 1888 that a law clerk named Frank E. McGurrin won a highly publicized typing contest with his self-taught touch-typing technique, and a new era was born. (In fact, McGurrin was proficient at touch typing ten years before the contest, because he’d been practicing in the evenings since 1876 so as to gain recognition as a fast worker. However, after receiving the $2 weekly pay-raise that he’d been looking for, he neglected to tell anyone else what he’d done.)

Of particular interest to us is the fact that an analysis of the average typewritten document reveals that the usage of the alpha keys by row is as follows (note that these values exclude the use of the numeric and punctuation keys):

 
  • Top row (Q, W, E, R, ...) 
  • = 52%
     
  • Middle row (A, S, D, F, ...) 
  • = 32%
     
  • Bottom row (Z, X, C, V, ...) 
  • = 16%

    Thus, it becomes apparent that users’ fingers spend only around one third of the time in their root position on the home row; the rest of the time they are stretching and straining to reach the keys on the other rows. We will return to consider this point in the next topic; suffice it to say for the moment that – lest you feel that the QWERTY keyboard is an unduly harsh punishment that’s been sent to try us – it's worth remembering that the early users had a much harder time than we do, not the least that they couldn’t even see what they were typing! This was due to the fact that the first typewriters struck the paper from the underside, which obliged their operators to raise the carriage whenever they wished to see what had just been typed, and so-called visible-writing machines didn’t become available until 1883.

    And finally, before we leap into the next topic, some additional points of interest are as follows:

    o) Sholes craftily ensured that the word "Typewriter" could be constructed using only the top row of letters. This was intended to aid salesmen when they were giving demonstrations.
    o) The terms uppercase and lowercase were handed down to us by the printing industry, from the compositors' practice of storing the type for capital letters and small letters in two separate cases. When working at the type-setting table, the compositors invariably kept the capital letters and small letters in the upper and lower cases, respectively; hence, uppercase and lowercase. Prior to this, scholars referred to capital letters as majuscules and small letters as minuscules, while everyone else simply called them capital letters and small letters.
    o) Nothing's simple in this world. For example, instead of the top row of characters saying QWERTY, keyboards in France and Germany spell out AZERTY and QWERTZU, respectively




     
    The Dvorak Keyboard
    Almost anyone who spends more than a few seconds working with a QWERTY keyboard quickly becomes convinced that they could do a better job of laying out the keys. Many brave souls have attempted the task, but few came closer than efficiency expert August Dvorak in the 1930s.

    When he turned his attention to the typewriter, Dvorak spent many tortuous months analyzing the usage model of the QWERTY keyboard (now there’s a man who knew how to have a good time). The results of his investigation were that, although the majority of users were right-handed, the existing layout forced the weaker left hand (and the weaker fingers on both hands) to perform most of the work. Also, as discussed in the previous topic, thanks to Sholes’ main goal of physically separating letters that are commonly typed together, the typist’s fingers were obliged to move in awkward patterns and only ended up spending 32% of their time on the home row.

    Dvorak took the opposite tack to Sholes, and attempted to find the optimal placement for the keys based on letter frequency and human anatomy. That is, he tried to ensure that letters which are commonly typed together would be physically close to each other, and also that the (usually) stronger right hand would perform the bulk of the work, while the left hand would have control of the vowels and the lesser-used characters. The result of these labors was the Dvorak Keyboard, which he patented in 1936:

    The Dvorak Keyboard

    In reality, Dvorak’s keyboard also included shift keys, but these are omitted from this illustration for reasons of clarity. The results of Dvorak’s innovations were tremendously effective, because the usage of the alpha keys by row is as follows (once again, these values exclude the use of the numeric and punctuation keys):

     
  • Top row (P, Y, F, G, ...) 
  • = 22%
     
  • Middle row (A, O, E, U, ...) 
  • = 70%
     
  • Bottom row (Q, J, K, X, ...) 
  • =  8%

    Thus, using Dvorak’s layout, the typist’s fingers spend 70% of their time on the home row and 80% of this time on their home keys. Thus, as compared to the approximately 120 words that can be constructed from the home row keys of the QWERTY keyboard, it is possible to construct more than 3,000 words on Dvorak’s home row (or 10,000 words if you’re talking to someone who’s trying to sell you one). Also, Dvorak’s scheme reduces the motion of the hands by a factor of three and improves typing accuracy and speed by approximately 50%, and 20%, respectively.

    Unfortunately, Dvorak didn’t really stand a chance trying to sell typewriters based on his new keyboard layout in the 1930s. Apart from the fact that existing typists didn’t wish to re-learn their trade, America was in the heart of the depression, which meant that the last thing anyone wanted to do was to spend money on a new typewriter. In fact, the Dvorak keyboard might have faded away forever, except that enthusiasts in Oregon, USA, formed a club in 1978, and they’ve been actively promoting Dvorak’s technique ever since. Coupled with the ability to re-configure computer keyboards (as discussed later in this document), their activities have reawakened interest in the Dvorak keyboard, to the extent that it is now used by a few businesses and educational establishments.




     
    The Best and Worst of Times
    Before we proceed to consider the advent of the printing telegraph, the teleprinter, and – ultimately – the computer keyboard, let us digress for a moment and ponder a few tidbits of trivia as follows…

    It was the best of times... In a 1930s survey of 16-year old girls across the United States, 32% stated that they wanted to grow up to be typists (which was seen as a glamorous profession) as opposed to only 5% who wanted to be film stars.

    It was the worst of times... Typewriter salesmen in the early 1900s were held in the same contempt that accident-chasing lawyers are today, because they used to pursue fire-fighters in the hope of selling new typewriters to burned-out businesses.

    ...and there were some pretty weird times... In the early 1920s, in order to indicate that businessmen were very busy, it became common for their letters to close with the words: “Dictated but not signed.” In an effort at one-upmanship this was soon supplanted by the words: “Dictated but not read.” Finally, in a surrealist attempt at Monty-Python foolishness, the yuppie-equivalent of the era started to use the words: “Dictated by transatlantic telephone and recorded on tape but not read and not signed,” which, when you think about it, was almost a letter in itself! (Lawyers occasionally use similar terms to this day, thereby protecting themselves from inadvertent dictation and transcription errors; the result being that irrespective of how badly they do their job ... it’s not their fault!)




     
    The Printing Telegraph
    As is discussed in the Paper Tapes and Punched Cards topic on this website, the first telegraph machines were invented in 1837 by Sir Charles Wheatstone in England and Samuel Finley Breese Morse in America. Morse’s machine was eventually adopted as the standard, because it was simpler, easier to construct, and more reliable. Morse’s original machines kept a record of incoming messages using an electromechanically controlled pencil that made marks on a moving strip of paper. The paper was driven by clockwork, while the lengths of the marks corresponded to the dots and dashes used in Morse Code. However, operators quickly realized that they could recognize the message by sound alone, so Morse’s recording devices returned to the nether regions from whence they came.

    Throughout the rest of the 1800s, there continued to be a strong interest in the idea of a printing telegraph. Much of the work toward realizing this dream was based on the concept of a wheel with characters embossed around the periphery. The idea was to use the incoming telegraph signals to spin the wheel by fixed steps until the correct character faced the paper, and to then propel that character onto an inked tape located in front of the paper. There were a variety of techniques for controlling the wheel, such as a single pulse for ‘A’, two pulses for ‘B’, three for ‘C’, and so on, with the wheel returning to a home position after each character, but this technique was very slow in terms of words-per-minute. Later techniques used a five-bit code created by the French inventor Jean Maurice Émile Baudot in 1880; this soon became known as the Baudot Code. The two-channel paper tape technique pioneered by Sir Charles Wheatstone (also discussed in the Paper Tapes and Punched Cards topic) was subsequently extended to handle the Baudot Code:

    Paper tape with 5-bit Baudot Code

    Using a five-bit code, it is possible to obtain 2^5 = 32 different combinations of holes and blanks (no holes). In the case of the Baudot Code, twenty-six of these combinations were used for letters of the alphabet, leaving eight spare combinations for an idle code, a space code, a letter-shift code, and so on. The problem was that there weren’t enough spare combinations left over to represent the numbers ‘0’ through ‘9’ or any punctuation characters.

    In order to solve this dilemma, the letter-shift code was used to emulate the shift key on a typewriter by instructing the receiver that any subsequent codes were to be treated as uppercase characters (in this context, uppercase was used to refer to numbers, punctuation, and special symbols). A second letter-shift code could subsequently be used to return the receiver to the default alphabetical character set.

    The five holes and blanks for each character were transmitted as a sequence of pulses and gaps, and decoded and printed at the receiving end by a variety of different techniques. Note the special characters such as BELL, which actually rang a bell on the receiver to alert the operator.

    The early systems required the operator to use a keypad with five separate keys, and to simultaneously push whichever keys were required to form a character. Later systems were based on a typewriter-style keyboard, whereby each typewriter key activated the five transmitting keys (or a paper tape punch) to establish the correct pattern. Unfortunately, none of these systems were tremendously robust or reliable, and they all suffered from major problems in synchronizing the transmitter and the receiver such that both knew who was doing what and when they were doing it.

    The original Baudot code became known as the International Telegraph Code No. 1. Sometime around 1900, another 5-bit code called the Murray Code was invented. The Murray Code eventually displaced the Baudot Code and became known as the International Telegraph Code No. 2. Unfortunately, everyone was hopelessly confused by this time – Murray’s name sank into obscurity, while Baudot’s name became associated with almost every 5-bit code on the face of the planet, including the International Telegraph Code No. 2.




     
    The Advent of the Teleprinter
    In 1902, a young electrical engineer called Frank Pearne approached Mr. Joy Morton, who was the president of the well-known Morton Salt Company. Pearne had been experimenting with printing telegraphs and needed a sponsor. Morton discussed the situation with his friend, the distinguished mechanical engineer Charles L. Krum, and they eventually decided they were interested in pursuing this project.

    After around a year, for one reason or another (different folks have their own versions of the story), Pearne wandered off into the sunset to become a teacher. Krum continued to investigate the problem and, in 1906, was joined by his son Howard, who had recently graduated as an electrical engineer. The mechanical and electrical talents of the Krums Senior and Junior complemented each other. After solving the problem of synchronizing the transmitter and receiver, they oversaw their first installation on postal lines between New York City and Boston in the summer of 1910.

    These devices, called teleprinters, had a typewriter-style keyboard for entering outgoing messages and a roll of paper for printing incoming communications. The Krums continued to improve the reliability of their systems over the years. By 1914, teleprinters were being used by the Associated Press to deliver copy to newspaper offices throughout America, and by the early 1920s they were in general use around the world.

    Meanwhile, toward the end of the 1920s and the early 1930s, scientists and engineers began to focus their attentions on the issue of computing. The first devices, such as Vannevar Bush’s Differential Analyzer, were predominantly analog, but not everyone was a devotee of analog computing. In 1937, a scientist at Bell Laboratories, George Robert Stibitz, built a digital machine called the Model K, which was based on relays, flashlight bulbs, and metal strips cut from tin-cans (the Model K was so-named, because Stibitz constructed most of it on his kitchen table).

    Stibitz went on to create a machine called the Complex Number Calculator and, at a meeting in New Hampshire in September 1940, he used this machine to perform the first demonstration of remote computing. Leaving his computer in New York City, he took a teleprinter, which he connected to the computer using a telephone line, to the meeting. Stibitz then proceeded to astound the attendees by allowing them to pose problems which were entered on the teleprinter; within a minute, the teleprinter printed the answers generated by the computer.

    By the 1950s, computers were becoming much more complex, but operators were still largely limited to entering programs using a switch panel or loading them from Paper Tapes or Punched Cards. Due to the fact that the only way for early computers to be cost-effective was for them to operate twenty-four hours a day, the time-consuming task of writing programs had to be performed off-line using teleprinters with integrated paper tape writers or card punches.

    As computers increased in power, teleprinters began to be connected directly to them. This allowed the operators and the computer to communicate directly with each other, which was one of the first steps along the path toward the interactive way in which we use computers today. By the middle of the 1960s, computers had become so powerful that many operators could use the same machine simultaneously, and a new concept called time-sharing was born. This meant that the computer could switch between users so quickly that each user had the illusion they had sole access to the machine. (Strangely enough, time-sharing is now only practiced in large computing installations, because computers have become so powerful and so cheap that everyone can have a dedicated processor for themselves).

    However, the days of the teleprinter in the computing industry were numbered; they were eventually supplanted by the combination of computer keyboards and Video Displays, and the sound of teleprinters happily chuntering away in the back of computer rooms is now little more than a nostalgic memory.




     
    The Computer Keyboard
    Unlike the electro-mechanical construction of the teleprinter, a modern computer keyboard is entirely electronic (excepting the mechanical aspects of the keys themselves). When a key is pressed it generates a binary pattern of 0s and 1s. The keyboard may be connected to the computer via a serial interface, in which case it transmits these pattern of 0s and 1s as a series of pulses. Alternatively, the interface may be parallel, in which case all of the bits forming the pattern are conveyed simultaneously on separate wires. In the case of the DIY Calculator, for example, we have implemented a virtual parallel interface, in which the keyboard is plugged into one of our 8-bit input ports:

    Visualizing the DIY Calculator's virtual QWERTY keyboard

    There are many ways in which a keyboard can be connected to a computer; however, the DIY Calculator follows a very simple scenario. Our virtual keyboard contains an 8-bit latch, and the outputs from this latch are fed through a virtual cable into one of the DIY Calculator’s 8-bit input ports. When the DIY Calculator is first powered up, the keyboard’s latch is loaded with a default value of all 0s. Whenever a key on the keyboard is pressed, it generates an 8-bit code which is stored in the latch, and whenever the DIY Calculator reads a value from the input port, it also resets the latch to contain an all 0s value.

    The detailed workings of the DIY Calculator’s keyboard are described in the documentation accompanying this release of the DIY Calculator, as presented on the Download page.




     
    Programmable and One-Handed Keyboards
    That’s pretty much the end of this topic, but before we finish, there are a couple of interesting points that deserve mention. First, the key-codes associated with early keyboards were hard-wired (fixed). Modern keyboards, by comparison, are significantly more sophisticated; some of them are re-programmable and may even contain their own dedicated microprocessor. Having a re-programmable keyboard offers such capabilities as being able to change the codes that are generated by each key (for example, allowing you to reprogram your ‘F’ key to make it generate the code for a ‘U’), and some allow a single key-press to generate an entire string of characters.

    Now this may not strike you as being amazingly useful at first, but it implies all sorts of possibilities. For example, you could reprogram your entire keyboard so as to act in the Dvorak style (of course, you’d have to re-label your keys as well). Even if your keyboard is not re-programmable, you can achieve the same results by writing a program that modifies the codes as it reads them from the keyboard; in fact you can obtain such software commercially. You can also purchase software that makes your keyboard suitable for one-handed typists. One such program – called Half-QWERTY – is available from the Matias Corporation, Rexdale, Ontario, Canada (the term "Half-QWERTY" is a trademark of the Matias Corporation):

    The left-hand side of a Half-QWERTY keyboard<

    This figure shows only that half of the keyboard that would be used by a left-handed one-handed typist (and we’ve omitted some of the annotations for clarity). With this portion of the keyboard, you use your left hand in the normal position to get the standard results. However, if you hold the space bar down while pressing another key, then you get the ASCII codes associated with the keys from the other half of the keyboard (tapping the space bar alone generates spaces as usual). This software also does the same sort of thing for the keys on the right-hand side of the board, thereby supporting right-handed one-handed typists.

    But we’ve digressed again. Let’s close this topic with a few things that are really quite useful to remember, such as the fact that the ASCII code for ‘A’ is hexadecimal $41 (from which you can work out all of the other uppercase letters: ‘B’ = $42, ‘C’ = $43, ‘D’ = $44, etc.), and that in order to calculate the code for a lowercase letter you need only add $20 to the code for its uppercase counterpart. Similarly, it’s useful to remember that the ASCII code for the number ‘0’ is $30 (which lets you work out all of the other numbers: ‘1’ = $31, ‘2’ = $32, ‘3’ = $33, etc.). Of course, it would be handy to memorize the complete table, but by remembering just these three codes you can quickly work out the codes for sixty-two of the characters in your head. It also usually comes in handy to remember that the ASCII code for a space is $20 and the code for an ESC (“Escape”) character is $1B. (See also the ASCII and EBCDIC topic on this site.)