Site menu About keyboards and keys
e-mail icon
Site menu

About keyboards and keys

e-mail icon

In today's world, with all attentions turned to mobile devices, many don't give a second look to the humble keyboard. Nevertheless, it still is the most important data input device, and it can be a pleasant work instrument that actually helps to streamline the expression of thought.

Figure 1: The setup that works best for me: nice trackball, wrist rest and 65% keyboard with `brown` switches.

Many great writers of the past cherished a particular model of typewriter and adopted certain tricks to write better. Jack Kerouac typed on reel paper to avoid the distraction of replacing sheets. I am not a writer, but I believe the expression of thought via keyboard has unique qualities. I can listen to someone and type unrelated things at the same time; typing does not use 100% of the brain. On the other hand, talking takes all my attention, and one can't talk and listen at the same time. Perhaps this is the reason voice recognition never reached the expected mass adoption.

Why to buy a mechanical keyboard?

Given the keyboard is still important, it makes sense to have the best one your budget allows for. "Best" is subjective, since it varies from person to person, and the most expensive is not always the truly best. But it is a given that a good keyboard, whatever the construction, will be more expensive than a run-off-the-mill unit that came for free with the computer.

In the eighties, the relative importance of the keyboard was much bigger than today. At a time, it was more common to have a joystick than a mouse, and computers are mostly employed in professional tasks. The keyboards were very well-made and durable, and very expensive as well. An original IBM unit cost between US$ 250 e 400, and a dollar bought twice as much back then.

Most keyboards are constructed using the rubber dome technique: a sandwich of an elastomer bed and a contact membrane. It is very cheap and it doesn't have to be awful; there are nice rubber dome keyboards e.g. the Apple and Logitech units. But the tactile feel is always the same.

A mechanical keyboard is build with individual, self-contained switches, which is inherently more expensive. The keyboard quality depends totally on switch's quality. There are good and bad switches; the point being there is a huge variety of them, with varying tactile feedbacks, varying weights, varying strokes, etc. Since the ideal keyboard is different for everyone, only the mechanical switches allow this ideal to be found, or to be sought at least.

It is noteworthy the venerable IBM PC keyboards were not purely mechanical. They had contact membranes to reduce costs. But every key also had some individualized moving parts that generated the famous and satisfactory "mechanical click". (Electrical typewriters' keyboards like IBM Selectric's were not particularly tactile, since the noise and vibration provided plenty of feedback.)

It is said that pornography moves the movie industry and can make or break movie-related technologies. The resurgence of mechanical keyboards owes a lot to the entertainment industryn, namely the videogame sector. The hardcore gamers were the first ones to demand better keyboards.

Figure 2: Typical gamer setup, full of lights, chrome and colors.

Unfortunately, gamers love input devices with that "space-cadet" style, and most mechanical keyboards are kitsch. Good taste form factor for input devices, neither kitsch nor sterile, is a recent inovation.

Given the low-latency requirement for competitive game playing, gamer (and mechanical) keyboards tend to be wired. Most are USB, but PS/2 is still preferred by some. (The PS/2 interface is more primitive, but it is faster, and allows for any number of simultaneously pressed keys, while the USB HID especification imposes a hard limit of six keys.)

But the physical characteristics tell only half of the story. The keyboard controller must do its job. "Gamer" keyboards tend to have good electronics, and a fair share of their good usability is due to a high-quality controller.

Let see an example. If you type BALA, you think you type like this:

Press B
Release B
Press A
Release A
Press L
Release L
Press A
Release A

But actually it happens more like this:

Press B
Press A
Release B
Press L
Release A
Press A
Release L
Release A

Fast typing "crosses" keys: at many moments, there are at least two pressed keys. Most keyboards deal correctly with that, but there are bad models that drop characters. When this happens, the reflex is to type with more tension on fingers, trying subconsciously to avoid "crossing" keys. It hinders the speed and the muscular tension eventually bings pain.

So, if your hands, wrists and arms had never hurt, and now your hands seem to be on fire after typing for a while, take a hard look on your input devices before seeing a foctor. I had such experiences with several bad keyboards in the past, and many times I took too much time discovering the true culprit.

Keyboard layouts and sizes

We define the standard PC keyboard as "100% size". It is the direct descendant of the IBM Model M. It started with 101 keys, but they can have up to 107 keys or more, depending on language and 'extra' keys.

Figure 3: Keyboard with `100%` of the expected PC keys. This layout is the same since the 1980s, solely augmented by the Windows keys.

Even though it is the most common layout, I don't find the 100% a good one, even less so nowadays. Most people don't use the numeric keypad, and the keyboard takes too much space on desktop. Moreover, the hand moves too far when reaching the mouse.

Given the real estate constraints, portable PCs and notebooks settled on smaller layouts, loosely named "75%" since they have about 75% as many keys as a kosher keyboard. There is no such thing as a standard for 75%, but it surely misses the numeric pad, and navigation keys are moved around so the keys fill a single rectangle.

Figure 4: 75% keyboard. This layout is very common in notebooks.

Every 75% keyboard has some sort of "Fn" key. It is a special key, not registered by the operating system; it helps to simulate missing physical keys. The idea caught on even in recent 100% keyboards, where Fn gives access to backlight settings and/or media keys.

Figure 5: HP Ultrabook keyboard, ABNT2 layout. Note the half-sized arrow keys.

Perhaps because notebooks took over desktops, or because the 100% keyboard is just too big, the 75% layout is very popular on desktop these days. The standard Mac keyboard is 75%.

Figure 6: Macbook Air keyboard. This exact layout is found on the standard desktop keyboard.

A small ergonomic issue of 75% PC keyboards is the shortened right Shift. The problem is worsened by some national layouts that need additional keys. The Mac version does not have this issue because it employs small arrow keys, and the rest of navigation keys is simply absent. A PC keyboard cannot do away with navigation keys, so the layout is more cluttered.

Another ancient layout that gained traction only in recent times, is the "tenkeyless", a.k.a. TKL, 80% or 85%. It is simply the 100% layout with sawed-off numeric pad. The first TKL keyboard was the IBM Model M Space Saving, released in 1987!

Figure 7: Kenkeyless keyboard, sometimes known as 85% or 80%.

In my opinion, the TKL is the best general-purpose layout. It keeps all navigation keys, has no ergonomic compromises, and takes a lot less of desktop's real estate.

From this point on, we get into "esoteric" layouts targeted to hobbyists, like the 60% layout. The nickname comes from the key count, around 61.

Figure 8: Modern 60% keyboard.

The 60% keyboard has no numeric pad, no function keys, and no navigation keys. These functions can still be reached through Fn+key combinations, which may or not be enough. In the PC world, the pioneer 60% product was the Happy Hacking (a.k.a. HHKB). But the layout itself is not exactly novel; the original Mac keyboard had only 59 keys.

Figure 9: Original Mac keyboard, without arrows. Source: Deskthority

Just a few years back, 60% keyboards were extremely expensive and hard to find. Today, there are far too many models. The current problem is to avoid the low-quality products.

This layout is indeed "complicated" for non-hobbyists, but the small footprint caught some attention. There is a slightly more friendly layout, the 65%. It was pioneered by the WhiteFox semi-artesanal model. One could argue that Apple IIC was the historical precedent.

Figure 10: Typical 65% keyboard.

The 65% layout is based on 60% but takes back the arrow and navigation keys. It is a particularly good keyboard for Macs, because function keys are not used often in Mac ecosystem. In fact, the most recent MacBook Pro replaced the function keys by a small touch screen.

The same way I elected the TKL the best whatever layout, I see the 65% the "safest" layout for hobbyists. That I like most in 65%'s (and dislike in 75%'s) is the full-sized Shift keys.

Since the 60% and 65% keyboards are mass-produced now, one cannot call himself a hipster by using one of these. You must use a 40% one to emerge from the pack!

Figure 11: Planck 40% keyboard. Source: Massdrop.

The 40% layout is further devoid of number keys and some symbol keys. There are so few keys, that two or more Fn-like keys are needed to allocate so many missing physical keys. The thing starts to look like a stenography keyboard.

A 40% keyboard looks more like a joke gift or a souvenir than something that is actually usable. But the 60% layout was ridiculed once, and many people have adopted it, so who knows. The layout is not completely unheard of, either: the Nokia SU-8W foldable keyboard was 40%-like.

In any case, this kind of keyboard is still difficult to get, and expensive. The first apparitions were completely handcrafted devices. Low-volume models showed up in 2016, and finally there are a couple of mass-produced models in 2018.

Figure 12: Magicforce 49 keyboard. Source: Massdrop

Mechanical switches

The name Cherry is almost a synonym for mechanical keyboard switches, almost like Gillette for razors. Cherry is a German manufacturer of all kinds of electric switches, working since 1970s. Its fame among keyboard hobbyists is relatively recent.

In order to identify each switch type, Cherry molds the plunger with different colors. These colors became synonymous with each major switch type, and other manufacturers tend to follow the same de-facto standard:

Figure 13: Animation of switch Cherry MX Blue. Source: Adafruit.

Figure 14: Animation of switch Cherry MX Red. Source: Adafruit.

Figure 15: Animation of switch Cherry MX Brown. Source: Adafruit.

The above colors are the main ones, and the easiest to find in ready-made keyboards. There are many, many others. For example, the green switch is a heavier blue, and the "clear" (milky) switch is a heavier and more feedbacky brown.

You can buy individual switches of any color, but it is very difficult to buy a ready-made keyboard with certain colors. If you really want one of these, you may have to buy a DIY kit.

Figure 16: Finally the government doing something useful, for a change. Using coins to measure the weight of actuation. This particular coin (BRL 0.10) weighs around 4.8g or 0.17oz.

For a long time, Cherry reigned over switchland. The sudden popularity of mechanical keyboards spawned many other brands, most of them Chinese. The general attitude about these "new faces" was disdain. Nowadays, brands like Kailh, Outemu and Gateron are deemed as good as Cherry, and the choice of switch just needs to concentrate on technical specifications. For example, the Kailh "blues" are lighter than Cherry ones, and many prefer the latter.

If you want to tinker with manyu different keys, you can buy a "demonstrator", a kind of a dummy keyboard in which you can fit many keys and feel them before you commit to a particular switch.

Figure 17: Switch demonstator. Source: CoolerMaster (manufacturer of this demonstrator).

Speaking of light switches, the general trend is using lighter keys, that need less effort. The IBM Model M keys took 80g of force to actuate; the Cherry MX take 50g in average, and now there keys as light as 27g. Another trend is the "slim" or short-stroke switch, with appearance and feel of notebooks and Mac keyboards.

Figure 18: Slim switch and the respective keycap.

The slim switches are ok except for the "blue" ones. In standard blue switches, the "click" happens when the contact mechanism strikes the bottom. In slim switches, the "click" mechanism is independend, and the actuation point is inconsistent with the audible feedback. Stick with brown or red slim switches, at least for now.

Almost every mechanical switch model is based on electrical contact. There are very few models based on other technologies (optomechanical, reed relay, Hall effect, capacitive, etc.).

Despite the legend, the IBM PC keyboards were membrane-based units, they don't possess individual, self-contained switches per key. Their major distinction is the multiple action of the return spring:

Figure 19: How the buckling spring works. Source: Wikipedia

The spring not only squeezes, but also buckles. A single spring per key wears four hats: key return, audible click, tactile feedback and contact actuation.

Keycaps

The proper keys, called keycaps, get less airtime than switches, but are very important, since they are the physical interface with our fingers. More recently, other factors have been paid attention to e.g. nice looks and the even the sound.

Keycaps are made in ABS or PBT plastic. ABS is cheaper and easier to make translucid. Almost all backlighted keyboards bring ABS keys. PBT is a better material in all aspects: more resistant to wear, does not get oily, it is denser, the impact sound is more satisfying, etc.

The symbols can be simply painted upon keycaps; or laser-carved and filled in (dye-sublimation), injected in another color (double-shot), etc. The obvious disvantage of painted symbols is the inevitable wearoff, but it is by far the cheapest method.

A good set of keycaps can be more expensive than a whole mechanical keyboard, even when made in China. The highest capital cost of plastics manufacturing is the injection mold, and keycap production takes many molds, even more when symbols are injected. Different keyboard layouts have modifier keys of different sizes, and keys can also vary in profile and height per-row.

The current fad in keycaps is the retro or "jukebox" keys, with big-font symbols and "aged" colors that evoke the solidity of ancient keyboards.

Where the PC keyboard layout came from?

I don't want to touch the QWERTY × Dvorak third rail, it is a discussion for the typewriter historians anyway. The focus here is the computer keyboard.

At present time, the authoritative source for keyboards is the USB HID specification. By the way, this document is authoritative for Bluetooth keyboards as well. The spec does not describe the physical layout, but it borrows heavily from the PC standards, helping to perpetuate them.

Going back in time, we have the IBM Model M, released in 1984 for the IBM PC/AT. Most new keyboards look almost the same as the Model M.

Figure 20: IBM Model M keyboard layout. Source: Wikipedia.

The only major change since Model M is the addition of "Windows keys" beside the Alt keys. Since Windows 95, a computer must have a keyboard with Windows keys in order to get the Designed for Windows logo. (At least these keys can be used in a Mac.)

It is also commonplace to add the so-called "media keys": volume, play/pause, etc. But many keyboards add these ones via Fn-key combinations, to avoid increasing even more the keyboard size.

Before Model M, there was the Model F, bundled with the original IBM PC/XT and the first PC/AT's. The Model F didn't have exclusive keys for navigation (they were overloaded on numeric pad) and the function keys were left of the alphabetic block.

Figure 21: IBM Model F layout. Source: Wikipedia.

If you have ever typed on a typewriter, you may have noted that symbols like $, %, &, quotes, slash, etc. are in different positions, when compared with a PC keyboard. Also, the symbol layout of e.g. an American keyboard is very different from many European keyboards. Why's that?

In the case of IBM PC keyboards, the symbol layout is a homegrown standard, inherited from the IBM Selectric typewriter, a very successful machine that sold for decades. I suppose that many European keyboard layouts tried to accomodate typewriters, and likewise IBM sought to please the typewriters who were IBM clients already.

Figure 22: Selectric typewriter. Source: Wikipedia.

Other computer manufacturers used to follow a standard named bit-paired, in which symbols are laid out in the same order as an ASCII table, in particular the symbols that overload number keys. In turn, the ASCII table was based on layouts of old mechanical typewriters.

Figure 23: Teletype ASR-33 keyboard layout. Source: Wikipedia.

Figure 24: ASCII table, with symbol sequence highlighted. Source: Wikipedia.

A quick way to detect a bit-paired layout is look to the symbol at key 2: if it is double quote, the layout is bit-paired. If it is the at-sign (@), the layout is IBM. Teletype machines and notable computers like the Apple II were important adopters of the bit-paired layout.

In countries where the teletype or the mechanical typewriter was the main reference for a keyboard, the national layouts tend to be bit-paired. One case is the Portuguese layout. In countries where Selectric sold well and/or there was a strong presence of American PCs, the national layout tends to be IBM. This is the case of the Brazilian ABNT2 layout.

The PC numeric block, whose arrangement is unlike a DTMF telephone, has a long history that goes back since the invention of the telephone. It is out of scope here, but it is an interesting read.

Still about the PC keyboard, there are the different plugs. Nowadays, everything is USB or Bluetooth, fortunately. Some PCs still have the PS/2 purple socket. As the name says, it came from the IBM PS/2 computer, which was a market failure but some PS/2 innovations made it into the PC "standard".

The IBM PC/AT keyboard employed a big DIN plug (most commonly used in in audio), electrically compatible with the PS/2 plug, so the adapter can be passive. On the other hand, the IBM PC/XT keyboard used the same DIN plug but it was electrically incompatible. To remedy this, PC keyboards used to have a "X/A" switch beneath until the 1990s to be usable with both types of PC.

And where did the Mac keyboard come from?

In my view, the Mac keyboard history can be divided in four "eras": ancient, middle ages, modern and contemporary.

Figure 25: First Mac keyboard. Source: Deskthority.

In "ancient" era, the keyboard was pretty dissimilar from PC, even though it wasn't bit-paired as the Apple II keyboard was. The 1985 Mac didn't have function keys, didn't have a Control key, and didn't offer navigation keys because the mouse was supposed to be the exclusive navigational input device. But arrow keys are really difficult to live without, and Mac Plus keyboard already brought them, in an awkward arrangement.

Figure 26: Macintosh Plus keyboard. Source: Wikipedia.

In the middle ages of Mac, the keyboard moved towards the IBM PC layout, even taking in some of the undesirable traits: huge size, numeric pad and a Googolplex of function keys.

Figure 27: Macintosh keyboard at the 1990s. Source: Deskthority.

But some Mac-specific traits were retained. Delete was in place of Backspace, the Command keys ("Apple keys", "clover keys") stuck to the sides of space bar, distinct Enter and Return keys, with distinct functions (Enter used to work like Shift-Enter in Windows). Even the notebooks kept both Enter and Return in their constrained layouts.

Figure 28: The iBook G4 keyboard. Source: PXHere

An important milestone was the USB adoption for mouse and keyboard. In the USB HID spec, "Windows key" and "Apple key" are the same thing. Having removed the most crippling difference between PC and Mac keyboards, it became viable to share keyboards between them.

The "modern age" of Mac started with adoption of Intel CPU. In the wake of this unprecedented nearing with the PC world, the Delete key's default behavior became Backspace-like, and the Enter/Return dichotomy was over.

Figure 29: Desktop keyboard from the Mac Intel era. Source: Wikipedia.

The PC layout had won over the Mac's, at that point of time. Since Apple keyboards were flashy and of good quality (like most Apple hardware), many PC forks bought Mac keyboards. Also, Bootcamp created a minor fad: buy a Mac to run Windows.

In this contemporary era, Apple is king of the hill once more, and again the Mac keyboard layout is going its own way.

Figure 30: Macbook Air keyboard.

The arrow keys are half-sized once again. The function keys never had special place in Mac; they shrunk on most keyboards, and ceased to exist as physical keys in newest Macbook Pros. The standard desktop keyboard follows the notebook layout; units with numeric keypads can be purchased separately.

Most mechanical keyboards aim the PC market, but using a PC keyboard with a Mac is not a problem. The only annoying difference is the different relative position of Windows/Apple key. This can be fixed in Settings. The hint for USB keyboards is: do the configuration with keyboard plugged directly to the Mac, not to a USB hub, otherwise the configuration will be lost upon reboot. Once the configuration was made this way, it can be plugged back to the hub.

Figure 31: MacOS keyboard modifier settings screen.

Another minor difference is the numeric pad: it is strictly for numbers in Mac, the Num Lock function is ignored by Macs.

Of course, it is possible to use a Mac keyboard in a PC. At least the small model is not ideal for this, in my opinion. The arrow keys are too small, and navigation keys take Fn-arrow combinations — Windows and Linux apps tend to use combinations like Control-Page Up/Down more often.

ANSI and ISO

Since the old days, when mechanical typewriters ruled upon the land, every country has its own "official" keyboard layout. There are three major keyboard layouts in the world: ANSI (EUA), ISO (international) and JIS (Japanese). The most visible difference between ANSI and ISO is the Enter key. ISO has an extra key (which costs a shorter left Shift), and the right Alt is repurposed to give access to special characters.

Figure 32: ANSI keyboard layout standard. Source: Wikipedia.

Figure 33: ISO keyboard layout standard. Source: Wikipedia.

Some layouts derived from ISO, like the Brazilian ABNT2, have two more keys than ANSI. Both Shifts have to be shortened to accomodate them.

How a keyboard works.

Down to the electrical level, a keyboard is very simple. In order to avoid the cost of one I/O line per switch, almost every keyboard is ipmlemented as a matrix of switches, as the Figure below. For a 1000-key device, 64 I/O lines are enough (32x32).

Figure 34: Electrical matrix of a six-key keyboard.

In the example above, when the switch B1 is closed, the electric current flows from column B to line 1. There are two crucial implementation details for this scheme to work:

First, only one column is fed at a time. The controller does the "scan", that is, feeds columns in turn and check which lines are energized, which correspond to pressed keys. If all columns were fed all the time, only one keystroke at a time would be detectable.

The faster the scan, the better the keyboard works. The response speed and the comfort are, in great measure, a product of the quality and the speed of the controller.

Second, the diodes that pair with each switch. Without them, some combinations of 3 or more keys are still problematic. It happens because the current leaks to other columns, running "backwards" through switches. For example, when A1, A2 and B1 are pressed, the "ghost" B2 key is also registered.

The lack of diodes is not a showstopper for "office" keyboards, it is more of a problem for games where 3 or more keys may be pressed at the same time. Diode-less keyboards are named 2KRO (two-key rollover).

In a capacitive keyboard, the "switches" are variable capacitors. The main implementation difference is using analog I/O lines (that most current microcontrollers have anyway). The scan current is a kind of alternate current and can flow through capacitors.

Do it yourself

The high point of the keyboard hobby is to build one by yourself. This is not difficult nowadays. The biggest opportunities to exercise creativity and craftsmanship lie on appearance and construction. Another great chapter of this hobby is to "ressurect" vintage keyboards, possibly replacing the controller.

The keyboard controller can be an Arduino running an open source firmware like QMK or EasyAVR. The only caveat is to choose a compatible board, which must be compatible with the firmware, must be capable of implementing a USB HID device, and must have enough I/O lines to run the matrix. It is also possible to add a Bluetooth module to make it wireless.

e-mail icon