TouchPads

In their developmental years, notebook computers used a variety of pointing devices. Several tried integrated trackballs. The designer’s whims determined placement—sometimes at the corner of the screen, sometimes below the keypad. In any case, the balls were small (they had to be to fit in a portable system), and the perfectly located trackball was rare, indeed.

Hewlett-Packard developed a pop-out mouse tethered to the right side of the system. The system detected mouse movement through the thin, flat tether, so you could hold the mouse in the air and its movements would nevertheless register. The downside was the need for space on the right, either air or desktop, a requirement not easily met in crowded aircraft.

The notebook industry needed a better alternative for a pointing device and found it in the TouchPad (the name is a trade mark of Synaptics Corporation). Almost by default the TouchPad became the most popular pointing device for notebook systems. It wasn’t that the TouchPad necessarily was so good. All the alternatives were worse. Figure 21.1 shows a TouchPad.

computer

The TouchPad detects the location of your finger on the pad by detecting the electrical capacitance of your finger. Your finger attracts a minute static electrical charge, which causes a small current flow in the circuitry of the TouchPad. The electronics associated with the TouchPad detects this minute current from two adjacent edges of the pad, so it can precisely locate your finger in two dimensions. By following changes in the current, it can determine the motion of your finger across the pad.

Mechanically, the foundation of the TouchPad is a printed circuit board. The top of the board holds a pattern of conductive sensor lines etched into place. The bottom of the board holds the electronics that make the pad work. A layer of Mylar covers the top of the board to protect it and gives your finger a smooth surface to trace across. Current designs are capable of resolving 1000 points per inch (40 points/mm).

A TouchPad is inherently an absolute position detector. The electronics of the pad converts the absolute location information it determines into mouse-like relative motion that can be sent to your computer in standard mouse protocol.

The TouchPad can be completely sealed from any kind of contamination, so it is an excellent choice as a pointing device for a machine that has to operate in a hostile environment. On the other hand, useful TouchPads must be large enough to conveniently register your finger movements. That means they steal space from the top of your notebook computer. Most notebook computer–makers take advantage of this space requirement to give you a hand rest below the keyboard—and to give the manufacturer more room for the components inside the computer.

Computer-makers can choose from several sizes of TouchPads for their products. Typically the active pad surface measures 62 by 46.5 millimeters, although larger (90.6 by 72.1 millimeters) and smaller (55.9 by 32.9 millimeters or less) versions are also readily available.

Most manufacturers locate the TouchPad just below the space bar on their keyboards. This location allows you to use your thumbs to move the mouse so you don’t have to take your hands from the home row when typing, an important consideration if you touch-type on your computer. Notebook computers differ in the height and sensitivity of their TouchPads. Although the differences are subtle, they affect usability. If the TouchPad height is wrong for your typing system, you’re likely to inadvertently move the mouse, or even activate it. You’ll want to try out the keyboard and the TouchPad of any portable computer that has one before you commit to buying it.

Trackballs

Just like its namesake in the Rodentia, the computer mouse needs room to roam and ends up almost anywhere. A mouse does not stay put because moving around is in its nature—and that’s how you use it.

The problem is that many folks do not have room for a roaming rodent. Their desks are just too cluttered or they are traveling with a laptop and neglected to carry a desk along with them into the coach-class cabin. More insidious issues also involve mice. Pushing a plastic rodent requires clumsy, wasteful, and tiring whole-arm movements. Mice are inefficient and exhausting.

The leading mouse alternative, the trackball, eliminates these problems. Essentially a mouse turned upside down, the trackball is much like it sounds—an often big ball that, when rotated, causes the screen pointer (mouse cursor) to track its movements. The trackball spins in place and requires no more desk space than its base, a few square inches.

Switches

As with mice, trackballs also require switches so that you can indicate when the cursor is pointing to what you want. Most trackballs have two or three pushbuttons that duplicate the selection functions of mouse buttons. Although some trackballs boast four buttons, the foursome typically functions as two duplicate pairs—mirror images—so that one trackball can serve either a right or left hand.

No standard exists for switch placement on trackballs because no consensus exists on how you are supposed to operate a trackball. Some are designed so that you spin the ball with your fingers. Others prefer that your thumb do the job. Which is better depends on whom you believe and how you prefer to work.

According to one theory, your fingers are more agile than your thumb and therefore more precise at spinning the ball, so you should get a trackball that you operate with your fingers. A competing theory holds that the thumb has more muscle control than the fingers, so a thumb-operated trackball makes more sense. Some trackball-makers wisely avoid such issues and make trackballs that can be used equally adeptly by the posed or opposed digit. In truth, which design and how you use a trackball is a matter of preference rather than hard science.

Ball Size

Another trackball design choice is the size of the ball itself and how it is retained inside the mechanism. Various products range in dimensions from the size of a shooter marble to those equaling cue balls. Bigger once was thought to be better, but the trackballs built into laptop and notebook computers are making smaller sizes popular.

Because no definitive study has shown the superiority of any particular size for a trackball, the best advice is to select one that feels best to you—or the one that comes already attached to your computer.

As with the balls in mechanical mice, trackballs naturally attract dirt. Although the trackball doesn’t pick up dirt from rolling around, dust does fall upon the ball and the oils from your fingers collect there, too. A readily removable ball can be quickly and easily cleaned. This sort of serviceability is absent from many trackball designs—something to consider if you plan on using your trackball for a long time.

Optical trackballs are growing in popularity. Most work like old-fashioned optical mice, only the pattern used for recognition is part of the ball itself. If you look closely at the big red ball that these optical trackballs use, you can see the faint lines that sensors inside the trackball mechanism detect. Optical trackballs require less maintenance than the mechanical kind, although if they get really dirty you’ll need to swab off their optical sensors, which are readily visible once you remove the ball. Use a Q-tip dampened with plain water. Resort to window cleaner only if using water alone is not successful.

Handedness

Most mice are symmetrical. Although two- and three-button mice define different functions for their left- and right-side buttons, most enable you to flip the functions of the buttons to suit right- or left-hand operation if what button falls under a given finger is important to you.

Trackballs, however, are sometimes asymmetrical. In itself, that can be good. An asymmetrical trackball can better fit the hand that it is designed for, right or left. But this handedness among trackballs poses a problem when you make your purchase—you have to determine whether you want a right- or left-handed trackball. Which you need does not necessarily correspond to the way you write. Some left-handed people prefer right-handed trackballs (and some righties like lefties). Consequently, a right-handed trackball isn’t always the best choice for a right-handed person. Before you buy a one-handed trackball, make sure you know which hand you will favor in using it. If you switch hands when you tire from using one hand for spinning your trackball all day long, you may not want a product with definite handedness at all.

Resolution

Somewhere buried in the specification of a trackball, you may find a resolution rating, either as the number of counts per inch (CPI) of movement or as DPI (as with mice). These figures are rarely published anymore because today’s driver software makes them irrelevant. Trackball resolution indicates how much you have to spin a ball to move the cursor on the screen—higher resolution requires more spin to move the cursor. Software drivers allow trackball manufacturers to give you several choices for the effective resolution of their products so that you can tailor their actions and reactions to match the way you work. In addition, most trackball-makers offer ballistic operation in which the translation of ball movement to onscreen cursor change varies with the speed of the ball’s spin. This yields fast positioning without loss of precision. The only problem is getting used to such nonlinear control in which the speed at which you spin the trackball has as much (and sometimes more) effect as how far you spin it.

Unlike most other peripherals, no one trackball is objectively better than the rest. Operating any of them is an acquired talent like brain surgery, piano-playing, or hair-combing. Any judgment must be subjective, and which is better suited a particular user depends most on personal preference and familiarity.

Mice

The computer mouse was the first computer pointing device, developed concurrently with the graphic environment—the problem and solution created together. Through its near 40 years of evolution, the mouse has changed surprisingly little. Today’s mice take the same basic form as the original—made to fit the hand—with the same control layout of buttons at your fingertips. Over so long a period, however, species naturally diverge, and so have mice. Where once there was only one breed of computer mouse, a mechanical creation wearing a single switch, now there are several.

Mice can be distinguished by five chief differences: the technology they use to detect motion (mechanical or optical), the number of buttons they have, the presence of a scroll wheel, the manner in which they connect with their computer hosts, and the protocol or language they use to encode the information they send to your computer. The last two of these differences also apply to other pointing devices, so we’ll hold back on our discussion of them until we’ve looked at mouse alternatives.

As a mechanical transducer, a mouse somehow has to be able to detect its motion across your work surface. Although engineers have a wide range of position-sensing technologies to choose from—they could even use the satellite-based Global Positioning System to determine the absolute location of the mouse and then deduce changes you make in its position—only two techniques have actually been used in practice. These are mechanical sensing and optical sensing.

Mechanical Mice

The first mouse was a mechanical design based on a small ball that protruded through its bottom and rotated as the mouse was pushed along a surface. Switches inside the mouse detected the movement and relayed the direction of the ball’s rotation to the host computer.

Although the ball is free to rotate in any direction, only four directions are detected, corresponding to two axes of a two-dimensional coordinate system. The movement in each of the four directions is quantified (in hundredths of an inch) and sent to the host as a discrete signal for each discrete increment of movement.

The mechanical mouse works on just about any surface. In general, the rotating ball has a coarse texture and is made from a rubbery compound that even gets a grip on smooth surfaces. In fact, you can even turn a mechanical mouse upside down and spin the ball with your finger (although you’ll then have difficulty fingering the pushbuttons!).

On the other hand, the mechanical mouse requires that you move it across a surface of some kind, and all too many desks do not have enough free space to give the mouse a good run. (Of course, if all else fails, you can run a mechanical mouse across your pant leg or skirt, but you’re likely to get some odd looks.) In addition, mechanical parts can break. A mechanical mouse tends to pick up dirt and lint, which can impede its proper operation. You should therefore regularly clean your mechanical mouse even if you think your desktop is spotless. Cleaning is easy, if bothersome. Twist the ring on the bottom of the mouse that retains the ball counterclockwise to release the ball. Remove both ring and ball. With a Q-tip dampened with rubbing alcohol, scrub off the residue you find inside, particularly that on the small rubber rollers (you may need to use your fingernail to pry loose some of the more tenacious grime). After the alcohol evaporates—usually after a few dozen seconds—reassemble your mouse.

Inside the mechanical mouse, the ball rolls against two perpendicular sensors. These sensors generate electrical pulses as they rotate, and the mouse sends the pulses to your computer. By counting the number of pulses in each direction, your computer can calculate the movement of the mouse.

The sensors can use various technologies. For example, the wheel may be optically encoded with an alternating pattern of black and white (or clear and opaque), and a photo-detector senses the changes. Alternatively, the sensor may use electromagnetic technology, sensing as a pattern of magnetic material passes a detector.

Optical Mice

The alternative to the mechanical mouse is the optical mouse. Instead of a rotating ball, the optical mouse uses a light beam to detect movement across your desk surface. Because no moving parts are involved, there’s less inside an optical mouse to get dirty and break.

Original Design

The first optical mouse required special patterned mouse pads to operate properly and used two pairs of LEDs and photodetectors on its bottom, one pair oriented at right angles to the other. Its matching mouse pad was coated with an overlapped pattern of blue and yellow grids. Each pair of LEDs and photodetectors detected motion in either direction across one axis of the grid. A felt-like covering on the bottom of the mouse made it easy to slide across the plastic-coated mouse pad.

The big disadvantage of the optical mouse was that it required that you use its special mouse pad and put the pad somewhere. The pad itself could get dirty, be damaged, or simply get lost. On humid days, the plastic coating of the pad might stick to your bare forearm and lift off in sheets. For these and other reasons, this form of optical technology has fallen from favor in mouse design despite its simplicity and low cost.

Current Design

Today’s optical mice bear little resemblance to the original optical designs. Comparing the two is like comparing an abacus to a computer. The original optical mouse only had to be smart enough to count lines as they rippled past a sensor. The current design uses a pattern-recognition system in a digital processor that in itself is more powerful than a complete computer of only a few years ago. The sophisticated pattern-processing capabilities of the modern optical mouse frees the critter from the tyranny of the mouse pad. Instead of following the preprinted pattern on the pad, today’s optical mice detect the minuscule variations in the brightness of whatever surface you run them across. They rely on the texture that’s present on most surfaces as the pattern they require to sense motion.

The modern optical system has several advantages. As with older optical mice, no moving parts are required to sense motion, so the mice require no maintenance. They don’t get dirty, and they do not wear out. Moreover, optical mice can work on surfaces that cause mechanical mice to falter, such as soft fabric or curved hard surfaces. On the other hand, current optical technology has a few shortcomings. The optical sensors do not work well on surfaces such as glass that lack visible detail or are reflective. In addition, surfaces can be too patterned. A highly repetitive pattern such as the screens applied to photos to print them in newspapers and magazines can confuse modern optical sensors.

A current optical mouse has three functional parts: an illumination system, a sensor that’s essentially a small video camera, and a digital signal processor for pattern recognition.

The optical mouse includes its own illumination for the surface over which it operates, generally an inexpensive red light emitting diode (LED). The self-contained light source is more than a means to operate the mouse when you turn the lights low. It’s key to creating a pattern on the work surface that the mouse can identify. When the light source is kept at an oblique angle, close to the surface and sharply focused, it can create a pattern of bright areas and shadows even on seemingly smooth surfaces.

The sensor detects the light-and-shadow pattern created by the illumination system on the work surface. Like a miniature video camera, the sensor comprises a lens and photodetector array. The lens focuses the pattern on the photodetector array, a matrix of light-sensitive CMOS elements. In today’s optical mice, this camera system is small and accurate enough to resolve details measuring about 800 to the inch.

The digital signal processor (DSP) samples the output of the sensor about several thousand times each second. It compares each image to the previous one, looking for changes in the light-and-shadow pattern. The processor can detect both the direction and magnitude in the shift in the pattern, which directly correspond to any movement of the mouse. Because the sampling occurs so often, sequential images overlap and changes are apt to be small, which allow relatively simple algorithms to suffice for detecting changes.

The choice of algorithm is the choice of the mouse’s designer. DSPs make brute-force methods easy. The DSP samples the brightness at every pixel of the sensor of the previous sample to the current sample. It then shifts the current sample one pixel in an arbitrary direction and checks the match. It tries every direction in turn, then shifts another pixel and tries each direction. Once it has measured the difference between all of these, it knows the one showing the least difference is the one that reflects the most likely movement of the mouse. Designers can simplify and quicken this procedure by adding more intelligence. For example, when the DSP finds an exact match, there’s no reason for it to keep checking. Or rather than choosing an arbitrary direction for its first test, it could start in the same direction as the last movement.

The sampling rate determines the maximum speed at which you can move your mouse and expect it to reliably indicate the motion. The slowest-sampling mice capture about 1500 images per second; the fastest, about 6000 images per second. According to Microsoft, a 2500-samples-per-second rate is sufficient to handle a mouse that moves at a physical rate of 11 inches per second. At 6000 samples per second, a mouse can track movement made at speeds up to 37 inches per second. Even the most rapid mouse movements rarely exceed 30 inches per second.

After the processor has detected the motion of the mouse, a modern optical mouse functions much like a mechanical mouse, relaying position information to the host computer through a serial or USB port.

Buttons

In its purest form, as envisioned by the inventor of the mouse, Douglas Engelbart, a mouse has exactly one pushbutton. Movement of the mouse determines the position of the onscreen cursor, but a selection is made only when that button is pressed, preventing any menu selections that the mouse has inadvertently dragged across from being chosen.

One button is the least confusing arrangement and the minimum necessary to carry out mouse functions. Operating the computer is reduced to nothing more than pressing the button. Carefully tailored menu selections allow the single button to suffice in controlling all computer functions. The Apple Macintosh uses this kind of mouse with one button.

As Microsoft developed Windows, however, its engineers opted instead for two buttons next to each other in place of one. Two buttons allow designers more flexibility—for example, one can be given a “Do” function, and a second, an “Undo” function. In a drawing program, one might “lower” the pen analog that traces lines across the screen while the other button “lifts” the pen.

Of course, having three buttons would be even better. The programmer would have still more flexibility. Even a fourth button could be added—but as the number of mouse buttons rises, the mouse becomes increasingly like a keyboard. It becomes a more formidable device with a more rigorous learning curve. A profusion of mouse buttons is counterproductive.

Three buttons would appear to be the practical limit, because three positions are available for the index, middle, and ring fingers while the thumb and pinkie grab the sides of the mouse. Designers have, however, created mice that are little more than miniaturized keyboards with dozens of buttons. Five-button mice are in current production.

In general, having three or more buttons is superfluous. Most Windows applications are designed to recognize only the two standard mouse buttons. Special applications may take advantage of additional buttons. Moreover, the driver software for most multibutton mice lets you decide the function to assign to each button. The software makes the button functions programmable, allowing you to make each button mimic your press of a series or combination of keystrokes on your keyboard.

The technology behind the buttons is simple, no matter the number of buttons. Each button presses down on an electrical switch or contact. The circuitry inside the mouse detects your press as the closure of an electrical circuit and then relays a digital code to your computer to indicate the button has been pressed. When you release the button, the circuitry responds with a different code that indicates you’ve let go. Each of the buttons has its own code value for its press and release.

Wheels

In 1997, Microsoft added a new feature to the design of its first Intellimouse, a rubber wheel nestled between its two pushbuttons. This scroll wheel allows you to scroll the screen without clicking on scroll bars.

Actually, the mouse’s wheel puts only about one-sixth of the circumference of a rubber tire under your finger’s control, the rest is hidden inside the mouse. You recognize it as a wheel only by its feel. The tire, about three-eighths inch across and made from textured rubber to give your fingers a better grip, fits a small plastic wheel-and-axle that’s molded as a single piece.

Inside the mouse, the wheel is connected to a rotary motion sensor. In fact, the wheel may be part of the sensor itself. As with the motion sensors of mechanical mice, the one used by the wheel may be based on optical or magnetic technology. The optical sensor detects the movement of a black-and-white pattern on the wheel, counting the stripes to detect how many degrees you’ve turned the wheel. Magnetic sensors detect a grooved or notched texture to the magnetic material on the wheel to count the degrees you spin the wheel. The electronics of the mouse send out codes corresponding to the wheel’s motion that are recognized by the mouse’s driver software.

The wheel should smoothly spin but doesn’t by design. To prevent you from inadvertently scrolling with every brush of the wheel, mechanical resistance is added to the wheel. Most often it takes the form of detents—the mouse notches from one position to the next as it rotates. A spring-loaded stop lodges its circular base into a matching notch or pit in the wheel. As you rotate the wheel, you force the stop upward, and it pushes itself back down into the next notch. The action is purely mechanical and independent of the motion sensing.

Resolution

Mice are sometimes rated by their resolution—the number of counts per inch (CPI) that they can detect. When a mouse is moved, it sends out a signal indicating each increment of motion it makes as a single count. The number of these increments in an inch of movement equals the mouse’s CPI rating.

The higher the CPI, the finer the detail in the movement the mouse can detect. Unless the mouse driver compensates, higher resolution has an odd effect. More resolution translates into faster movement of the mouse pointer onscreen because the screen pointer is controlled by the number of counts received from the mouse, not the actual distance the mouse is moved. Consequently, a higher-resolution mouse is a faster mouse, not a more precise mouse.

The true limit on how precisely you can position your mouse cursor is your own hand. If you want to be more accurate with your mouse, you can compensate for your human limitations by opting for less resolution from your mouse. Because you have to move your mouse physically farther for each onscreen change, a lower mouse resolution helps you put the cursor where you want it.

Wireless Keyboards

As computers merge into entertainment systems, you’re apt to sit farther and farther away from the display screen. A home entertainment computer, for example, fits into your living room more like a television set, at one end of the room with you at the other. Just as a wireless remote control has become de rigueur for your television, a wireless keyboard gives you the same flexibility when the computer takes over.

Wireless keyboards are two-piece systems. Each involves the keyboard itself, which functions as a transmitter, and a base station, which acts as the receiver. (Keyboard communications are actually a two-way street, but the transmitter/receiver distinction is valid as a view of the data you generate by typing.) A single base station can serve both a wireless keyboard and wireless mouse (or other pointing device).

The first wireless keyboards used infrared technology (similar to, but predating, IrDA), with the interface (a little red optical sensor) built in to the host computer. Today, however, wireless systems are add-ons that plug into conventional interfaces—either the keyboard port or USB port. The connection between the base station and your computer is completely conventional. Your computer receives exactly the same scan codes or USB packets it would expect from a plug-in keyboard.

All the magic is in the wireless link. And wireless links might as well be magic because they need to follow no standards other than the Federal Communications Commission’s limits on unlicensed radiation. That is, as long as they don’t use too much power—definitely less than what is apt to cause interference—and stick to the authorized frequency bands, wireless keyboard-makers are free to do whatever they want with their signals.

The range of these wireless systems stretch from about 5 feet to more than 30 feet. Unfortunately, the only guidance available as to the range of a particular keyboard is the claim of its manufacturer.

Keyboard Electrical Function

In the macroscopic world in which we live, switches operate positively without hesitation or doubt. Switch on a light, and it comes on like, well, a light. In the realm of microelectronics, however, switches are not so certain in their first steps toward changing state. As a switch makes contact, it hesitates, letting tiny currents flow and then halting them; then letting more flow. These initial jitters are called switch bounce, and they result from a number of causes. The contact materials of most switches are far from perfect. They may become coated with oxidation or other impurities, and they often don’t mesh together perfectly. The contacts touch, bounce, cut through the crud, and finally mate firmly together. In the process, many tiny pulses of electricity can slip through. These pulses aren’t enough to affect a light bulb but can be more than sufficient to confuse a semiconductor circuit.

For use in computer circuits, switches require special electronics to remove the jitters, to “debounce” their contacts. Such debouncing circuits monitor the switch contacts and change the hesitating initial stabs at changing state into a sharp, certain switch. Unfortunately, each switch contact requires its own debouncer. This is not much of a concern with a single switch, but it can be a nightmare for the designer who must debounce the 101 switches in a typical keyboard.

Instead of individual debouncing, computer keyboards use a different process for eliminating the hesitation from keyboard switches. The keyboard electronics do not detect when each switch changes but rather check periodically to see whether a switch has changed. When the electronics note a change in the state of a switch corresponding to the press of a key, they generate an indication of the switch switching that is sent along to your computer.

This process has its own shortcomings. The go-and-look method of detection adds a brief wait to signaling each keypress. Moreover, each and every key must be individually checked. But the high speed of today’s computer circuits makes this system entirely workable. The process is reduced to a routine—the keyboard electronics scan each key at rates approaching a million times every second, looking for a change in the state of any key. In general, a microprocessor (an 8048-series device in the most popular keyboards) scans the keyboard for current changes every few microseconds, and the minute current flow caused by a keystroke can be detected. Because a slight chance exists that random noise—the stuff that must be debounced away—could cause a current pulse similar to that generated by a keystroke, keyboards may require that the increased current flow be detected during two or more consecutive scans of the keyboard.

In today’s computers, the keyboard can use either of two technologies to relay the effects of your keypresses to your computer. In the traditional design, used in systems since the first computers, the keyboard sends data to your computer in the form of scan codes. The personal computer industry is making an effort to shift keyboard communications from scan codes to formatted data sent through the USB port.

Keyboard Port

In the traditional (legacy) keyboard design, the keyboard connects to your computer and sends its codes, called scan codes, through a specialized serial port. A microprocessor in the keyboard assigns a code of pulses to your every keypress, and a second processor called a keyboard controller converts the scan code pulses into bus-compatible data using a hexadecimal code.

When it receives a scan code, the keyboard controller chip issues an interrupt to notify your computer’s microprocessor that you’ve pressed a key and it had better do something about it. To service the interrupt, your computer sorts through the scan codes and figures out which keys are pressed and in which combination. The program code for doing this is part of your system’s BIOS. The computer remembers the condition of the locking shift keys by changing special memory locations, called status bytes, to reflect each change made in their condition.

Each press of a key generates two different scan codes—one when the key is pushed down and another when it pops back up. The two-code technique allows your computer system unit to tell when a key is pressed and held down—for example, when you hold down the Alt key while pressing a function key.

Rather than a single standard for scan codes, there are three. These comprise three operating modes and correspond to the three generations of keyboard development. Mode 1 is the system used by the original 83-key keyboard of the first computers. Mode 2 is the system used by the 84-key keyboard of the computer AT. Mode 3 is the system introduced with the 101-key keyboard design that’s now ubiquitous among computers. In general, more modern keyboards can emulate older models by shifting their operating modes based on commands sent to the keyboard by your computer.

In any given operating mode, each key generates a unique scan code. Even if the same legend appears on two keys, such as the duplicate number keys in the alphanumeric and numeric/cursor keypads, the individual keys generate the same codes. The code for a given key is determined by its position and is not affected when the Caps Lock or other shift key is in effect. In Mode 1, all scan codes are single bytes, and the make and break codes of individual keys are different. In Modes 2 and 3, scan codes may be one or more bytes. In general, the make code is a single byte and the break code is two bytes, the byte F0(hex) followed by the make code.

Although scan codes were originally fixed to key positions rather than characters, when manufacturers alter the arrangements of their auxiliary keys they maintain the same scan codes for the characters as in the basic design. Otherwise, every key layout would generate different scan codes and confuse both your computer and you as you type. Foreign languages have their own scan code mappings. Each different keyboard design for a specific language puts different characters on punctuation keys, so the scan codes elicited by these characters will vary in languages other than English.

Modern 101-key and 104-key keyboards have two Enter keys, one on the alphanumeric keypad, the scan code for which is listed with the rest of the keys in this pad, and a second one in the numeric/cursor keypad. This second Enter key—as well as the duplicate number and math function keys on the numeric/cursor keypad—has its own scan code. As a result, your computer can distinguish which Enter or number key (or whatever) you press, just as it can distinguish between left and right Shift keys. Although for most operations the two keys work identically, in some cases they do not. For example, hotkey sequences often make use of one or the other of the Shift keys but not both.

All computer keyboards have dedicated function keys that have no predefined role. What they do often changes with each application you run, although some programmers strive for a bit of consistency (such as making F1 elicit help and F10 exit). The function keys may be arrayed in two vertical rows of five on an 83-key or 84-key keyboard or as a single horizontal row of 12 on 101-key and 104-key keyboards. In either arrangement, the scan codes of these keys are the same, although the scan codes of F11 and F12 won’t be available from keyboards with only ten function keys.

Each key of the dedicated cursor keypad that’s interposed between the alphanumeric and numeric/cursor keypads on 101-key and 104-key keyboards also generates a scan code distinct from the keys with duplicate functions located elsewhere.

Normally you do not have to deal with scan codes. The computer makes the translation to numbers and letters automatically and invisibly. The converted information is used in generating the information that appears on your monitor screen, and it is also made available to the applications you run and even the programs you write. Sometimes, however, when you write your own programs, it is useful to detect every key change. You may, for example, want to cause something to happen when a certain key combination is pressed. Your program need only read the keyboard input port and compare what it finds there to a scan code table.

Your computer receives these scan codes at a special I/O port that operates much like a serial port without explicitly following the RS-232 standard. Instead of an array of data and handshaking signals, the keyboard uses only two. By activating or deactivating these two signals in combinations, the system manages communications both from the keyboard and, in all but the initial computer keyboard design, from the host system. Although the very first computers used a one-way flow of data from the keyboard to the computer, current keyboards use a bidirectional interface with its own command protocol.

Protocol

Keyboards use different serial codes for bytes depending on operating mode. In Mode 1, the standard protocol uses nine bits per byte. The first bit is a start bit, which must be a logical one (1). The eight data bits follow in sequence, ordered from least significant to most. In Modes 2 and 3, keyboards use an 11-bit protocol. Each byte begins with a start bit, but a logical 0. Next, the eight data bits follow in sequence, least to most significant. Next comes a parity bit. All keyboards use odd parity, so this bit is set to a logical one or zero so that an odd number of logical ones appears in the combination of eight data bits and one parity bit. The protocol ends with a stop bit, which is always a logical one. Table 20.1 lists the details of this protocol.

computer

Handshaking

The signaling and handshaking system is quite elaborate. The keyboard uses the clock line to send out signals that synchronize the bits on the data line with the receiver in your computer. In addition, the computer uses the clock line to throttle the flow of data from the keyboard. The clock line uses tri-state logic, which allows both ends of the connection to alter the signal. Normally the keyboard supplies a voltage to the clock line and interrupts it to provide the synchronizing signal. Your computer can also pull down the voltage—essentially shorting it out without harm to the keyboard—as a means to signal its data needs. The data line also uses tri-state logic.

The keyboard monitors the status of both the data and clock lines to determine when it can send information to your computer. Only when both the clock and data lines are high, not pulled low by your computer, will the keyboard send character data to your computer. When the clock line is low, the keyboard holds any characters it wants to send in its buffer. If the clock line is high but the data line is held low by your computer, the keyboard waits to receive a command sent from your computer. The keyboard monitors the clock line throughout the transmission of each byte, and if your computer pulls the line low before your keyboard sends off the parity bit, the keyboard stops its transmission and holds the character in its buffer, waiting until the clock line going high signals that it can retry its transmission.

To send a command byte to the keyboard, your computer first checks to see whether any data is coming its way. To immediately stop the data flow, it pulls the clock line low. Then, by letting the clock line go high again and pulling the data line low, it signals the keyboard that it will send data. The keyboard then counts the bits on the data line. If it receives the correct number, it sends an acknowledgment byte, FA(hex), back to the computer. If the bit count is wrong, it asks for a retransmission with the FE(hex) command.

Software Commands

Your computer has a modest repertory of commands that it can issue to the keyboard to adjust its internal operation. It can alter the operating mode of the keyboard (and hence, which scan codes it sends out) with the command F0(hex) followed by the mode number. It can also alter the typematic rate using the command F3(hex) or alter the status of the locking key indicators with the command ED(hex). Table 20.2 summarizes the commands that your computer can send your modern keyboard. Very old keyboards, such as the 83-key models accompanying the first computers, cannot receive these instructions because of their unidirectional interface. When in Mode 1, keyboards only respond to the Reset command FF(hex), but they then can switch to another mode to act upon other instructions.

computer

computer

In addition to its scan codes, the keyboard has a modest range of commands and status information it can relay back to your computer. For example, it can tell your computer that it has too many characters in its in-board buffer, whether it has properly received a command from the computer, and the status of its internal self-test. Table 20.3 lists these commands and status signals.

computer

To start communications, the keyboard starts by sending a series of the self-test passed character—AA(hex)—to your computer using the wrong parity to indicate that it has not been initialized. When your computer has gone through the boot process sufficiently to be ready to accept data, it sends an error acknowledgment to the keyboard—FE(hex). The keyboard responds by correcting the parity and sending the self-test passed character, providing of course it passed its internal self-test. At this point, the keyboard and computer are ready for normal operation.

Host Interface

The keyboard interface inside your computer is a complete subsystem with its own dedicated microprocessor. The original design used an Intel 8042 microprocessor for handling keyboard communications, but in modern computers, circuitry equivalent to such a microprocessor is typically built in to the chipset. This microprocessor monitors the data and clock lines linking it to the computer, deciphers the serial code, and repackages it in parallel form for passing to your computer.

Your computer receives data from the keyboard interface and sends data to it through a pair of I/O ports. When the ports receive a byte and have it ready for processing by your computer, they generate a hardware interrupt.

In modern computers, the location of keyboard ports and the interrupt generated by the controller may vary with the hardware design and BIOS of your computer. If you are curious, you can check the ports used from the Windows Control Panel by selecting the Keyboard icon and then the Resources tab. You’ll see a display like that shown in Figure 20.5.

computer

At this point, the keyboard controller passes a scan code sent from the keyboard to your system, and the keyboard BIOS routine determines the character to be sent to your operating system. The standard BIOS interrupt–processing routine generates a second interrupt that permits a subroutine to process the scan code before it gets processed into a character. Under Windows, these BIOS routines are replaced by keyboard drivers that perform the same functions. By default, current consumer versions of Windows install two keyboard drivers—a real-mode driver (keyboard.drv) and a protected-mode driver (vkd.vxd). You can see the drivers installed in your system or change the drivers using the Drivers tab of the Keyboard Properties dialog box in Windows, as shown in Figure 20.6.

computer

Compatibility

The vast majority of today’s keyboards use the same interfaces, protocols, and scan codes and are essentially interchangeable at the electrical and logical level. Because key layouts often differ, however, your fingers might find some compatibility problems, especially when confronted with the layout of the keys on a new notebook computer.

You may encounter compatibility problems in two cases, however. Very old computers and keyboards used a one-way, send-only keyboard design that’s different from current designs. Most of these predated the current 101-key design. In the transition period between the acceptance of the two designs, many aftermarket keyboards were switchable between two operating modes. The old, one-way mode was designated XT (or rarely, PC) mode. The modern mode is distinguished as AT (or rarely, PS/2) mode. Very old computers require XT mode keyboards.

The connectors used by very old keyboards also differ from the current design, using a large five-pin plug, as discussed later. Note that the connector is not a reliable guide to the operating mode of the keyboard. Keyboards using the large, old, five-pin connector may operate as either XT or AT keyboards. All keyboards using the modern, miniaturized connector operate in the AT mode (although some old models may have switches allowing support of XT mode).

Another compatibility issue affects keys beyond the 101 defined for the PS/2 keyboard design. Your computer needs a software driver to recognize these additional keys. Windows generally can identify your keyboard when it scans your hardware and set itself up accordingly with the correct driver (or it will ask you for a disk).

If you have reason to believe that its choice was incorrect or if you want to install a keyboard manually into Windows for any reason, Windows gives you that option. You access the keyboard selection in the General tab of the Keyboard Properties dialog box. To open the Keyboard Properties dialog box, select the Keyboard icon in Control Panel.

If the keyboard Windows displays is not the one you want, click the Change button. Windows will respond with a list of keyboards it inherently knows how to manage, as shown in Figure 20.7.

computer

As with installing any hardware on your computer, Windows allows you to install a keyboard without built-in Windows support using a driver supplied by the keyboard-maker. If the keyboard you want to use is not listed as one of those directly supported, click the Have Disk button and slide the floppy disk or CD supplied by your keyboard vendor into the appropriate drive slot when Windows instructs you to. You specify a disk location and complete the installation process as you would with any other hardware device.

Connections

The scan-code system and serial signaling simplify the connection scheme used by computer keyboards. Scan codes are sent from the keyboard to the computer serially so that only one wire conductor is needed to convey the keyboard data information. A second conductor is required to serve as a return path for the data signal; as a ground, it serves as a common return for all other circuits in the keyboard cable. To synchronize the logic in the keyboard with that in the computer, a separate wire is used for a keyboard clock signal. A fourth and final wire is used to supply the keyboard with the five-volt direct current power it needs to operate. These four conductors are all that is necessary to link keyboard to computer.

The physical embodiment of those signals is the keyboard connector. Nearly all keyboards now use a miniature six-pin DIN connector. This design is usually called PS/2-style because IBM introduced it with its PS/2 computers in 1987, and it has served every since.

The six pins are arrayed in a circle around a rectangular plastic tab that, along with three guides in the shield, keys the connector against improper insertion. As with the five-pin connector, the pin numbers follow an irregular pattern. Figure 20.8 shows the six-pin miniature DIN keyboard connector and its signal layout.

computer

Only four pins are significant to keyboard use: Pin 1 is assigned keyboard data; pin 3, ground; pin 4, five volts; pin 5, keyboard clock. Pins 2 and 6 are reserved, and the shield is attached as a chassis ground. Table 20.4 lists the signal assignments on the PS/2-style keyboard connector.

computer

Older keyboards use a five-pin plug—a standard, as opposed to miniature, DIN connector. Because the five-pin and six-pin keyboard connectors use the same signals with only a slight rearrangement, a simple adapter will convert one style of connector to another. These keyboard adapters are readily available on the computer parts market. If you’re so inclined, you can make your own using the interconnection guide given in Table 20.5.

computer

In some computers, the keyboard cable can be disconnected from the keyboard itself. This detachable design makes the cable easy to service (by replacing it) and a single keyboard adaptable between five-pin and six-pin cabling standards. The keyboard-to-cable connection uses a modular (AMP) jack on the rear of the keyboard with a matching plug on the cable, as shown in Figure 20.9.

computer

As shown in the figure, this modular connector has the following signal assignments: A, reserved; B, keyboard data; C, ground; D, keyboard clock; E, five volts; F, reserved. When looking at the gold contacts of the connector, the contacts are labeled in reverse alphabetical order from left to right. Table 20.6 summarizes these signal assignments.

computer

USB Port

In the long run, computer-makers hope to make the keyboard port as obsolete as steam-powered personal computers. The alternative is the Universal Serial Bus (USB), which computer-makers hope will replace all the other ports on the back of your computer.

As computers shift to the use of the Universal Serial Bus, keyboard connections will move to this high-speed interface. USB-based keyboards were displayed as early as February, 1996, but the early introduction proved premature. Even in 2003, computer-makers prefer the conventional keyboard interface because it is cheap and reliable, despite admonitions from Intel and Microsoft to move to USB. As the interface matures, however, USB keyboards are destined to become more popular.

Because USB is designed and designated a universal interface, one that will link devices other than keyboards, it is treated in a separate chapter devoted to ports, Chapter 10.

The inner workings of USB keyboards are immaterial to your computer. It just looks for data packets received through the USB port. Any packets containing keyboard data get routed by the USB driver to the keyboard driver of the operating system. Then the operating system pulls the data from the packets to see what you’ve typed. If your computer wants to send a command to the keyboard, it notifies the keyboard driver, which generates the code of the command and passes it along to the USB driver, which routes it out the port and to your keyboard as another packet on the USB circuit.

The flaw in this design is that it doesn’t work until the operating system and its USB drivers load. Before then, the keyboard driver has no route through which to get keystroke codes. That’s all right, because if the operating system hasn’t loaded, the keyboard driver won’t have loaded, either. With neither the USB nor keyboard driver running, your computer faces a problem if it needs to read the keyboard while booting up—for example, to step through the setup menu.

Your computer’s BIOS makes up for this flaw. It patches together the old and new keyboard systems.

Keyboard Layouts

On a full-size keyboard, the spacing between the keycaps for individual character keys is 0.75 inch (19 millimeters), center to center. The keycaps themselves are about 0.5 inch (12.5 millimeters) across at the top, dished to help you place your fingers. The shape of this curve is somewhat arbitrary. Most American designs put a concave cylindrical curve (it’s curved only around the longitudinal axis) at the top of the keys; some European designs use a concave spherical curve.

QWERTY

The one unvarying aspect of keyboards also seems the most odd—the nonalphabetical arrangement of the alphabet keys. Anyone new to typing will be amazed and perplexed at the seemingly nonsensical arrangement of letters on the keys of the typical computer keyboard. Even the name given to this esoteric layout has the ring of some kind of black magic or odd cabala—QWERTY. Simply a list of the first six characters of the top row of the nominal arrangement, the absurdity harks back to the keyboard of the first practical typewriter.

There is no doubt that the standard arrangement is not the only possible ordering of the alphabet—in fact, there are 26! (or 26 factorial, exactly 403,291,461,126,605,635,584,000,000) different possible arrangements of letters alone, not to mention the further complications of using rows of different lengths and nonalphabetic keys. QWERTY is not the only possible layout, and it’s probably not the best. Nor is it the worst. But it is the standard that millions of people have spent years mastering.

A legend surrounds the QWERTY key arrangement. The typewriter was invented in 1867 by Christopher Sholes, and his very first keyboard had its letter keys arranged alphabetically. Within a year of his invention, however, Sholes discovered what he viewed as a superior arrangement, QWERTY.

According to the common myth, Sholes created QWERTY because typists pounded on keys faster than the simple mechanisms of the first typewriters could handle their strokes. The keys jammed. The odd QWERTY arrangement slowed down the typists and prevented the jams.

Sholes left no record of how he came upon the QWERTY arrangement, but it certainly was not to slow down speedy typists. High typing rates imply modern-day touch typing, ten fingers flying across the keyboard. This style of typing did not arise until about ten years after Sholes had settled on the QWERTY arrangement. Typewriter development was indeed slow—the Shift key wasn’t added to the basic design to permit lowercase characters until 1878!

Other hypotheses about the QWERTY placement also lead to dead-ends. For example, breaking a strict alphabetic order to separate the keys and prevent the type bars (the levers that swing up to strike letters on paper) from jamming doesn’t make sense, because the arrangement of the type bars has no direct relationship to the arrangement of keys.

Dvorak-Dealey

The most familiar challenger to QWERTY, one that crawls in a distant second in popularity and use, is the Dvorak-Dealey letter arrangement, named for its developers, August Dvorak and William L. Dealey. The name is often shortened to Dvorak. Figure 20.1 shows the Dvorak layout applied to a typical keyboard.

computer

The Dvorak-Dealey design incorporates several ideas that should lead to faster typing. A basic goal is to foster the alteration of hands in typing. After you strike one letter with a key under a finger of your left hand, the next key you’ll want to press likely is under a right-hand finger. This hand alteration is a faster typing strategy. To make hand alteration more likely, the Dvorak-Dealey arrangement places all vowels in the home row under the left hand’s fingertips and the consonants used most often in the right hand’s home row. Note that the Dvorak-Dealey arrangement was developed for speed and does nothing to make the keyboard more alphabetic or easier to learn to use.

The first publication of the Dvorak-Dealey keyboard was in the 1936 book Typewriting Behavior, authored by the developers of the new letter arrangement. To back up the philosophic and theoretical advantages attributed to the Dvorak-Dealey arrangement, tests were conducted in the 1930s on mechanical typewriters, amounting to typing races between the QWERTY and Dvorak-Dealey key arrangements. Dvorak and Dealey ran the tests, and—not surprisingly—they came out the winner by factors as large as 30 percent.

Dvorak believed in both his keyboard and his test results and wrote papers promoting his ideas. Alas, the more he wrote, the greater his claims became. Articles such as “There Is a Better Typewriter Keyboard” in the December 1943 issue of National Business Education Quarterly has been called by some experts “full of factual errors.” Tests run by the United States Navy and the General Accounting Office reported much more modest results for Dvorak.

Notwithstanding the exaggerated claims, the Dvorak layout does offer some potential advantages in typing speed, at least after you become skilled in its use. The penalty for its increased typing throughput is increased difficulty in typing when confronted with a QWERTY keyboard.

The design of the computer makes converting to Dvorak relatively easy. Whereas typewriters have to be redesigned for the new key arrangement, you can just plug a new keyboard into your computer. Commercial Dvorak keyboards often are available by special order.

In fact, if you don’t mind your keytop legend bearing no likeness to the characters that actually appear on your screen (and in your files), you can simply reprogram your computer to think that it has a Dvorak keyboard by intercepting the signals sent by the keyboard to your computer and converting them on the fly.

Windows makes specific provisions for the Dvorak key arrangement. The standard keyboard driver allows you to select the Dvorak option. From Windows Control Panel, select the Keyboard icon. Next, select the Language tab, on which you’ll find a Properties button. Clicking this button will reveal a screen like that shown in Figure 20.2, one that allows you to choose the keyboard language. The Dvorak layout is available as an option in the United States layout, as shown in the figure.

computer

Control and Function Keys

The classic key layouts fail when it comes to computer keyboards. The array of keys they offer simply doesn’t match the needs of a computer control system. Certainly the alphabet hasn’t changed—at least over the 125-year history of the QWERTY arrangement. But computers have needs not addressed by the letters of the alphabet or basic numerals. They require navigation keys and buttons to control system functions. Even that’s not enough to provide an easy-to-use control system for applications and operating systems. In addition (as well as subtraction and other math operations), a dedicated numeric keypad can help immensely when your work involves entering a lot of numbers.

Each additional key adds another option in laying out the keyboard. Another word for it is potential chaos. Although computer manufacturers have exploited some of the opportunities to craft their own, peculiar keyboards—particularly in notebook computers—the basic design has gravitated toward a single standard.

A common design for all keyboards seems an obvious idea, but it didn’t arise spontaneously. After a short, wrenching evolution between 1981 and 1987 involving three major design changes, the layout has remained subject to tinkering. The last significant change came when Microsoft added three keys tied specifically to functions in the Windows operating system. Although most keyboard-makers stick to this arrangement, they sometimes alter the size and shapes of some keys—just enough to frustrate you during your first attempts at using an unfamiliar computer.

As with QWERTY, the arrangement of auxiliary keys is quite arbitrary, to the point of defying explanation. As personal computers were emerging as a technology, the Video Data Terminal with a detached keyboard was still a relatively new concept, as were function keys. The first personal computer keyboard appeared to be designed by programmers rather than typists—it had a small Enter/Return key but placed the function keys handily left of the alphabetic keys, just a pinkie-touch away. Experienced typists—many of the early adopters of personal computers, and the most vociferous of them were writers—complained, and the engineers complied, enlarging the Enter key to make the 84-key AT keyboard (named after the 1984 IBM Personal Computer AT, which originated it).

The next wave of new users, more interested in mastering software and entering numbers, complained that the left-hand function keys didn’t correspond to the help legends that sometimes appeared in a row at the bottom of the screen. As a result, in its next generation of personal computers, the Personal Systems/2 of 1987, IBM created a third design. It was one of those attempts to satisfy everyone that leaves everyone dissatisfied. To add extra features, IBM’s engineers added keys, making a total of 101. Termed the Advanced Keyboard by IBM, it is also commonly called the Enhanced Keyboard. Figure 20.3 illustrates the United States layout of the Advanced Keyboard.

computer

The key additions were several. A new, dedicated cursor control pad was provided separate from the combined numeric and cursor pad, and several other control keys were duplicated in another small pad. Two new function keys (F11 and F12) were added, and the whole dozen were moved to a top row, above and slightly separated from the alphanumeric area. Duplicate Ctrl and Alt keys were provided at either side of the spacebar, and Caps Lock was moved to the former location of the Ctrl key.

A few functions of Windows don’t fall readily under the caps of 101-key keyboards. To better match the operation of Windows, many keyboard-makers now add three additional keys—two Windows keys and a pop-up menu key—in the otherwise vacant area around the spacebar, which has also shrunk to provide more room. The two Windows keys, identified by the zooming window logo on their caps, serve as attention keys to pop you into the Windows Task Manager. One is located on the left of the space bar between the Ctrl and Alt keys. The other fits on the right side, just right of the right Alt key. The third key serves to select the item at which the mouse cursor points. It is located to the right of the right Windows key.

Most makers of Windows keyboards also modify other keys for easier typing. In particular, they enlarge the Enter key to the size used by the lamented 84-key design. To provide the extra key area, the backslash shrinks and moves upward, sandwiched between a shortened Backspace key and the plus/equals key. Figure 20.4 illustrates the most common form of the 104-key Windows keyboard.

computer

To distinguish their products and make computers easier to use, some keyboard-makers have added application pushbuttons to their keyboards that are keyed to particular software features. In most cases, these added controls take the form of round, rubberized pushbuttons in a line above the function keys. Popular Microsoft keyboards, for example, provide pushbuttons for commonly used Internet functions, such as triggering your browser forward and back as well as entering your email system.

The functions of these added buttons are defined by the keyboard driver software. The keyboard simply passes a code to your computer indicating you’ve pressed one of the buttons. The driver software then checks which button you’ve pressed and passes a predefined command along to your software. If your software differs from what Microsoft expects, the keys might not work properly. If you have installed the keyboard properly, you can adjust its settings through the Keyboard Properties menu in Windows Control Panel.

Ergonomic Designs

No one likes to type, except possibly masochists and men from Mars. For most people typing is a pain. In fact, extended typing without taking a break can cause pain and worse, occupational ailments such as Carpal Tunnel Syndrome. The best way to avoid such problems is to avoid typing—yet another good reason to quit early each day. When you can’t avoid pounding on the keyboard all day long, the next best choice is to find a keyboard that minimizes the pain.

Human factors specialists who deal in the science of how people relate to the workplace and machines, called ergonomics, point out that the keyboard was not designed with human beings in mind. The original layout of keys in four (or five or six) rows was a mix of the arbitrary and the needs of the original lever-operated typewriter mechanism. As good as straight rows are for pounding on paper, they are an anathema for most human hands. Normal typing forces you to splay your hands apart, bending them at the wrists and keeping them in that position while you type away. The bend stresses the ligaments in your wrist and squeezes the nerves that lead into your hand through the carpal tunnel (essentially a hole in the bones of your wrist). Over time the stress adds up and may eventually impair the functioning of your hands.

Computer keyboards do not suffer the same constraints as the keyboards of mechanical typewriters. Designers can put the key switches in any position they choose. Some of the more imaginative designs result in ergonomic keyboards. These split the alphanumeric keypad in two and angle the two halves in respect to one another. The result is an odd-looking keyboard—at least to the eyes of those long used to the mechanical typewriter design—that’s supposed to make typing less painful.

The theory underlying the ergonomic design is that the typing position of your hands on the split keypad lets you keep your wrists straight. Your hands follow more of the natural position they would assume when hanging down from your sides (hence the name of Microsoft’s Natural Keyboard). Because there is less stress, prolonged typing should be less painful on a split-pad keyboard.

With old-fashioned keyboards, and especially those of mechanical typewriters, you must bend your wrists in another direction, vertically, for normal typing. When your arm lies flat on your desk, you must angle your hands upward to reach the keys of a keyboard lying atop your desk. When you use the little feet at the back of your keyboard to angle your keyboard further, you must bend your wrists even more.

As with the horizontal bending of your wrists, these vertical bends can also cause stress and, possibly, carpal tunnel syndrome or other occupational ailments. Consequently, many keyboards have extended wrist rests that force you to minimize the bending of your wrists.

Unlike changes to the layout of key caps, these ergonomic designs require a brief (if any) training period in which to accustom yourself to them. They might seem odd at first, but you can quickly start using them effectively. The choice of a regular or ergonomic design is simply a matter of your own preference.

Keyboard Legends

Each key on a keyboard bears a legend identifying the letter, symbol, or function it activates. These legends are usually applied using one of three technologies:

* Double-shot keycaps have the legend molded in. Making each keycap is a two-step process. Black plastic is molded into the inner shape of the keycap that attaches to the switch mechanism. The legend protrudes from the top of this inner cap. Then light plastic is molded over and around the inner cap with the legend showing through the top.

Using the double-shot technique, each keycap for each key is a separate and different part that must be individually installed in the correct position on the keyboard as the final step in the production process. Assembly is complex, and stock-keeping of parts and completed keyboards can be costly. Although once popular, this technology has fallen from favor.

* Pad-printed keycaps have their legends stamped into place. A machine inks on the legends on all the keys on a fully manufactured keyboard at one swoop. Then a transparent protective layer is applied over the ink and is baked to a permanent finish. Notebook computers and keyboards with light legends over dark caps often have their keys pad-printed. In the case of notebooks, the assembled keyboard gets baked before the keyboard is installed on the computer.

* Laser-marked keycaps have their legends burned into place with a laser. The process is akin to a laser printer that operates on keycaps rather than plastic. The complete keyboard is put into a big machine with a laser and mirrors, and the laser burns the legends into all the keycaps in one operation. The advantage of the process is that the legends only need to be applied at the last moment, right before the keyboard is shipped out with a new computer, and the language and layout of the keyboard need not be set until then. The process is fast, the legends are long lived, and stock-keeping is simplified. Most new keyboards are now laser-marked.

Keyboard Touch

Today the principal dividing line between keyboards is not technology but touch—what typing actually feels like. A keyboard must be responsive to the touch of your fingers—when you press down, the keys actually have to go down. More than that, however, you must feel like you are typing. You need tactile feedback, sensing through your fingers when you have activated a key.

The most primitive form of tactile feedback is the hard stop—the key bottoms out and stops moving at the point of actuation. No matter how much harder you press, the key is unyielding, and that is the problem. To assure yourself that you are actuating the key, you end up pressing harder than necessary. The extra force tires you out more quickly.

One alternative is to make the key actuate before the end of key travel. Because the key is still moving when you realize that it registered your keystroke, you can release your finger pressure before the key bottoms out. You don’t have to expend as much effort, and your fingers don’t get as tired.

The linear travel or linear touch keyboard requires that you simply press harder to push a key down. In other words, the relationship between the displacement of the key and the pressure you must apply is linear throughout the travel of the key. The chief shortcoming of the linear touch keyboard is that your fingers have no sure way of knowing when they have pressed down far enough. Audible feedback, a click indicating that the key has been actuated, can help, as does the appearance onscreen of the character you typed. Both slow you down, however, because you are calling more of your mind into play to register a simple keystroke. If your fingers could sense the actuation of the keys themselves, your fingers could know when to stop reflexively.

Better keyboards provide this kind of tactile feedback by requiring you to increase pressure on the keyboard keys until they actuate and then dramatically lower the force you need to press down farther until you reach the limit of travel. Your fingers detect the change in effort as an over-center feel. Keyboards that provide this positive over-center feel are generally considered to be the best for quick touch-typing.

A spring mechanism, carefully tailored to abruptly yield upon actuation of each key, is the classic means of achieving a tactile feel and can be adapted to provide an audible “click” with every keypress. The spring mechanism also returns the key to the top of its travel at the end of each keystroke. The very first computer keyboards were elaborate constructions that used a separate spring assembly for each key. Modern keyboards use a single overall spring assembly or, more likely, an elastic rubber dome that pops between positions. Dome-based keyboards give satisfying tactile feedback, but individual keys may sporadically require increased force for a stroke or two, thus subverting their smooth operation. Nevertheless, the low cost and good reliability make dome technology popular among keyboard-makers.

Soft-touch keyboards use a compressible foam to work as the spring mechanism as well as to cushion the end of each keystroke. Soft-touch keyboards give a more linear feel but are preferred by some people for exactly the same reason others dislike them—their lack of snap and quiet operation.

Another influence on the feel of a keyboard is the force required to actuate a key. Some keyboards require you to press harder than others. In general, however, most keyboards require between 1.9 and 2.4 ounces of pressure to actuate the key. Stiff keyboards can require as much as three ounces.

On March 22, 1999, Key Tronic Corporation introduced the first varied key-feel keyboard, one that required differing amounts of pressure to activate its keys. Called ErgoForce by its developer, the varied key pressures are tailored to the fingers expected to activate them. For example, the “A” key, which is usually operated by the left little finger, requires only 1.25 ounces (35 grams) of force to activate, whereas the spacebar requires 2.3 ounces (80 grams). Depending on the location of each key, it requires one of five levels of effort to activate—35, 45, 55, 65, or 80 grams. According to the manufacturer, the tailored effort makes typing easier and improves the level of typing comfort for people using a keyboard for long periods.

Keyboards also differ in how far you must press down on a key to actuate it. Full-travel keyboards require your fingers to move down between 0.14 and 0.18 of an inch to actuate a key. Studies show that the full-travel design helps typists achieve high speeds and lower error rates. In laptop and notebook computers, where every fraction of an inch counts, however, keyboards sometimes are designed with less than full travel. A short-travel keyboard actuates with less than about 0.10 inch of key travel. Whether you can live with—or even prefer—a short-travel keyboard is a personal issue.

Keyboard Technologies

The keyboard concept—a letter for every pushbutton—is almost ancient, dating back to the days of the first typewriter. The design seems fixed in stone. Actually, it’s the product of something even more immovable—human inertia. The basic layout and function of the keyboard has changed little since the last half of the 19th century, and the mold for the computer refinement was first cast in 1987. No matter what computer you buy today, you’re almost certain to get a keyboard that follows the now industry-standard design. That’s good because you can confront any computer and start working in seconds. But that’s also bad when those seconds stretch to hours of uninterrupted typing.

All keyboards have the same function: detecting the keys pressed down by your fingers and relaying that information to your computer. Even though two keyboards may look identical, they may differ considerably in the manner in which they detect the motion of your fingers. The technology used for this process—how the keyboard works electrically—can affect the sturdiness and longevity of the keyboard. Although all operate in effect as switches by altering the flow of electricity in some way, the way those changes are detected has evolved into an elaborate mechanism. The way that technology is put into action affects how pleasant your typing experience is.

Nearly every technology for detecting the change in flow of electricity has been adapted to keyboards at one time or another. The engineer’s goal has been to find a sensing mechanism that combines accuracy—detecting only the desired keystroke and ignoring errant electrical signals—with long life (you don’t want a keyboard that works for six words) and with the right “feel,” the personal touch. In past years, keyboard designers found promise in complex and exotic technologies such as Hall-effect switches, special semiconductors that react to magnetic field changes. The lure was the wonder of magnetism—nothing needs to touch to make the detection. A lack of contact promised a freedom from wear, a keyboard with endless life.

In the long run, however, the quest for the immortal keyboard proved misguided. Key boards rated for tens of millions of keypresses met premature ends with a splash from a cup of coffee. In the end, manufacturers opted for the simplest and least expensive, hard-contact technology, as close to a plain switch as you can get without a wall plate. The chief alternative, capacitive technology, led the pack at the start. It was more reliable, longer lived, more complicated—and for a long while, more popular. It was also more expensive. In today’s dollars, the keyboard of the first computer cost more than an entire current computer system. Something had to give.

Contact

The direct approach in keyboards involves using switches to alter the flow of electricity. The switches in the keyboard do exactly what all switches are supposed to do—open and close an electrical circuit to stop or start the flow of electricity. Using switches requires simpler (although not trivial) circuitry to detect each keystroke, although most switch-based computer keyboards still incorporate a microprocessor to assign scan codes and serialize the data for transmission to the system unit.

Design simplicity and corresponding low cost have made switch-based keyboards today’s top choice for computers. These keyboards either use novel technology to solve the major problem of switches—a short life—or just ignore it. Cost has become the dominant factor in the design and manufacture of keyboards. In the tradeoff between price and life, the switch-based design is the winner.

Three switch-based keyboard designs have been used in computers: mechanical switches, rubber domes, and membrane switches.

Mechanical Switches

Mechanical switches use the traditional switch mechanism, precious metal contacts forced together. In the discrete switch design, the switch under each keyboard station is an independent unit that can be individually replaced. Alternatively, the entire keyboard can be fabricated as one assembly. Although the former might lend itself to easier repair, the minimum labor charge for computer repair often is higher than the cost of a replacement keyboard.

The contact in a mechanical switch keyboard can do double-duty, chaperoning the electrical flow and positioning the keycaps. Keyboard contacts can operate as springs to push the keycaps back up after they have been pressed. Although this design is compelling because it minimizes the parts needed to make a keyboard, it is not suited to computer-quality keyboards. The return force is difficult to control, and the contact material is apt to suffer from fatigue and break. Consequently, most mechanical switch keyboards incorporate springs to push the keycaps back into place as well as other parts to give the keyboard the right feel and sound.

Although several manufacturers have built keyboards with mechanical switches, the design has fallen from favor. Probably less than two percent of all keyboards use discrete switches.

Rubber Dome

Rubber dome keyboards combine the contact and positioning mechanisms into a single piece. A puckered sheet of elastomer—a stretchy, rubber-like synthetic—is molded to put a dimple or dome under each keycap, the dome bulging upward. Pressing on the key pushes the dome down. Inside the dome is a tab of carbon or other conductive material that serves as one of the keyboard contacts. When the dome goes down, the tab presses against another contact and completes the circuit. Release the key, and the elastomer dome pops back to its original position, pushing the keycap back with it.

The rubber dome design initially won favor on notebook computers, where its resistance to environmental stress (a euphemism for “spilled coffee”) was a major strength. The design also is inexpensive to manufacture. The switches for the entire keyboard can be molded as one piece about as easily as making a waffle. The design was readily adapted to desktop keyboards and provides the foundation for many inexpensive, lightweight models.

Properly designed, a rubber dome keyboard has an excellent feel—the give of the individual domes can be tailored to enable you to sense exactly when the switch makes contact. A poor design, however, makes each keypress feel rubbery and uncertain. Moreover, some elastomers have a tendency to become stiff with age, and as a result, some keys can become recalcitrant.

Membrane Keyboards

Membrane keyboards are similar to rubber domes except they use thin plastic sheets—the membrane—printed with conductive traces rather than elastomer sheets. Most designs use a three-sheet sandwich—top and bottom sheets with printed contacts and a central insulating sheet with holes at each key position to hold the contacts apart. The top sheet is dimpled, and pressing down on the dimple pushes the top contact down to meet the bottom contact. The dimple snaps from one position to another, giving distinct tactile feedback that indicates when you’ve pressed a key.

The membrane design often is used for keypads to control calculators and printers because of its low cost and trouble-free life. The materials making contact can be sealed inside the plastic, impervious to harsh environments.

By itself, the membrane design makes a poor computer keyboard because its contacts require only slight travel to actuate. However, an auxiliary key mechanism can tailor the feel (and key travel) of a membrane keyboard and make typing on it indistinguishable from working with a keyboard based on another technology.

Non-Contact

The biggest problem with all contact keyboards is the contacts themselves. Although switches work well for room lights, they are fickle when it comes to the minuscule voltages and currents used by computer systems. At a microscopic (and microtemporal) level, making a contact is an entire series of events—tiny currents start and stop flowing until finally good contact is made and the juice really gets going. The brief little pulses that precede making final contact aren’t apparent when you throw a light switch, but a computer can detect each little pulse as a separate keystroke. Keyboards have special circuits called debouncers that make your keypresses unambiguous. However, as contacts age, they oxidize. Oxidation puts a less-conductive layer of oxide on the contacts and makes your keypresses even less reliable—to the point they cannot be unambiguously detected.

Early in the history of the computer, manufacturers scorned contact keyboards because they knew traditional contact materials were fated to short lives, not the tens of millions of keystrokes they expect from keyboards. Modern keyboards use ceramics and exotic metals that, resistant to oxidation, can achieve the required life.

The most popular of the non-contact designs is the capacitive keyboard. Capacitance is essentially a stored charge of static electricity. Capacitors store electricity as opposite static charges in one or more pairs of conductive plates separated by a nonconductive material. The opposite charges create an attractive field between one another, and the insulating gap prevents the charges from coming together and canceling out one another. The closer the two charged plates are, the stronger the field and the more energy that can be stored. Moving the plates in relation to one another changes their capacity for storing a charge, which in turn can generate a flow of electricity to fill up the increased capacity or drain off the excess charge as the capacity decreases. These minute electrical flows are detected by the circuitry of a capacitive keyboard. The small, somewhat gradual changes of capacity are amplified and altered so that they resemble the quick flick of a switch.

The first computer keyboards and some of the more robust designs of the past all used capacitive technology. The best of these designs could work reliably for 100 million keystrokes compared to 10 to 15 million for most contact designs. Although that extended life may be commendable, most people never typed even 10 million keystrokes during the lifetime of their computers. They usually move on to another computer well before the keyboard wears out. The added cost of the capacitive design consequently yields no additional useful life, and the design has fallen from favor. The last capacitive keyboard from a major manufacturer rolled out of the Key Tronic Corporation factory in early 1999.

Computer Output

At the other end of the computer, its output, where it needs to communicate to you, the history is much the same as the input side. The first computers used hardcopy printed output to express their answers or displeasure. Even Charles Babbage envisioned printed paper as the basic output for his Analytical Engine. After all, paper has an enduring advantage. You can see your results for as long as you want, and more importantly, you can see your mistakes. When you can hold the evidence of your mistakes in your hand, you can repair your errors more quickly.

But putting all output on paper has a big disadvantage. If you’ve ever waited for an important job to print, you know the frustration of watching each line slowly appear down the paper. Printing is a slow, mechanical process. Trying to run an interactive computing session while relying on your printer for output would be like running a relay race with a glacier anchoring your team.

Much as the video data terminal changed computer input, it revolutionized computer output. Without it, interactive computing would be no more than a dream. But the computer terminal didn’t appear on the market like Athena, fully armed and prepared for battle. It entered this world as a teletype machine that wrote with lighted phosphors instead of ink (and at the same speed). Over the years, the computer terminal picked up momentum, graphics, colors, and finally windows.

At first, the personal computer simply split the video system from the keyboard and inserted the computer in the middle. Communications with the display followed the same routine as the terminal and the teletype—the slow, serial stream of text characters. In a quest for speed, engineers sidestepped their own best plans and revealed the magic of direct access and painting pictures directly on the screen. Today’s systems add a second computer to your computer, one solely aimed at making images on your screen faster than you can blink.

Teletype to Terminal

When engineers ushered in Harvard Mark I in 1943, television was little more than a bluish dream in the minds of broadcasters, barely off to a flickery black-and-white start. The first commercial licenses went into effect in July, 1941, and then went on hold for the years of World War II. Putting text on the screen meant holding up a printed card. The only output devices available to the first computer were mechanical, and the one most readable by humans was printed paper, courtesy of the teletype machine.

The early connection between computer and teletypes lingers on in the lingo. Even today, the data that’s sent by a computer to its output device as a string of printable characters is still termed teletype output. The character string, if converted to the correct code, would run a mechanical teletype happily through reams of coarse paper.

The first terminals were little more than teletypes that printed on the screen instead of onto paper. Essentially the same minimal design survives today at the dumb terminal, named not for the engineers who design it but for how it processes what you see. A dumb terminal is not smart enough to do data processing on its own. It puts each character on its screen exactly as it is received through the umbilical cable linking it to its computer host. Compared to the mechanical teletype, refinements are few. Instead of rattling off the edge of the paper, a too-long electronic line more likely will “wrap” or scroll down to the line below. The terminal never runs out of paper—it seemingly has a fresh supply of blank screen below, rolling upward as necessary to receive each additional line. But the output it generates is even more tenuous than the flimsiest tissue and disappears at the top of the screen, perchance never to be seen again.

In the electronic form of the computer terminal, the teletype method of text-handling means that when one character changes on the screen, a whole new screen full of text must be generated and sent to the terminal. The system cannot back up to change the one character, so it must rush headlong forward, reworking the whole display along the way.

Add brains to a dumb terminal and you get a smart terminal. A microprocessor inside lets the smart terminal recognize special commands for formatting its display and may even be able to do some computer-like functions on its own.

BIOS Support

Computers act like dumb terminals in their most basic display functions. They put characters on the screen like teletypes to produce teletype output under the guidance of their BIOSs. In fact, the basic computer BIOS gives several layers of teletype output. In the most primitive, a program must load one character at a time into a microprocessor register and issue a video interrupt—specifically, interrupt 010(hex). The BIOS then takes over, instructing the microprocessor to check where to put the character (a several-step process in itself) and then pushing the character into the appropriate place in memory. The BIOS then returns control back to the program to process the next character. The most advanced teletype mode lets a program put an entire line of text on the screen through a similar, equally cumbersome process.

In basic teletype mode, characters are written on the screen from left to right, from screen top to bottom, merely scrolling after each line is full or ended with a carriage return. More advanced display technologies are able to write anywhere on the monitor screen using formatting instructions much as smart terminals do. For example, commands in the computer BIOS let your programs locate each character anywhere on the screen.

HTML

The great advance made in communications by the Internet has at its heart teletype technology. Your computer displays basic Web text in teletype style—one character at a time as if it came as part of a string from a teletype. The chief difference between what came across the teletype wire and what comes through your Internet connection is the code. Teletypes used Baudot; the Web uses Hypertext Markup Language (HTML), layered upon the ordinary ASCII code that specifies individual letters.

HTML uses the processing power of the computer to improve on basic teletype technology. Certainly it’s quieter. Unlike a teletype machine, your screen does not chatter like the teeth of a freezing epileptic. More importantly, the HTML character stream includes formatting codes that allow it to specify type size and faces, even colors. Although your computer still pops each character on your screen in the order it appears in the HTML string, it can make changes in the appearance of each character based on the in-stream codes.

The codes act as switches. When one appears in the data stream, it switches on a text feature—for example, turning the text red. All later text gets displayed in red until another HTML code turns it off or sets another color.

Some HTML codes affect the formatting of characters displayed on your computer’s screen (for example, indenting lines). This formatting is relative rather than absolute. Its effects vary depending on the size and shape of your Web display. For example, a simple tab might take up half a column on a narrow window or a few character widths in a wide one. In this way, HTML operates like a teletype—the characters in the HTML stream come out without regard to the size or shape of the display medium.

More recent revisions to HTML allow the Web to go beyond minimally formatted text. Tables allow you to create more structure in your text displays. In addition, you can embed streams of images with your text characters. Even these elements, however, are handled like the letters and numbers relayed to an old teletype display. In other words, old ideas don’t die. They just go online.

Character Technologies

The most notable aspect of teletype technology, be it on your screen or on the Web, is that it is character oriented. The smallest unit of information it deals with is a text character. At the times when your computer steps back to this technology of yesteryear—for example, the first few moments of booting up, before it spins its disks to load the basic code of your operating system, or when you read your email—your computer lets you see its world only in terms of letters and numbers.

Somehow your computer must organize the characters it wants to display. Teletype machines handle this matter mechanically. They simply stamp each character on a piece of paper. The typing automatically organizes the text and the inky image preserves it. Your computer isn’t so lucky. It has to organize the text in electronic form, it has to be able to move the character representations around inside its circuitry, and it has to keep the characters you see glowing on a screen that would rather remain permanently black.

Your system has two alternative ways of dealing with the characters it wants to put on your screen. It can store and manipulate them in the form of individual characters, or it can break the characters down into tiny pieces called a bitmap, in which each piece representing one of the bright dots appearing on your computer display. Your computer uses both of these technologies every day. Although Windows treats your entire display screen as one giant bitmap, applications running under Windows often send information to the operating system to display in character form.

Character-Mapping

When your computer deals with characters as a fixed unit, one code per indivisible character, it uses a technology termed character-mapping. The name refers to the character map, a special range of addresses that’s sometimes called screen memory or display memory. The memory of the character map is reserved for storing the characters that will appear on the screen. Simple programs such as your computer’s bootup BIOS routines write text on the screen by pushing bytes into the proper places in that memory. Just as a street on a roadmap corresponds to the location of a real street, each byte of display memory corresponds to a character position on the screen.

The most common operating mode of the character-mapped display systems used by computers when they boot up divides the screen into a matrix (essentially a set of pigeonholes, with each hole corresponding to one position on the screen) that measures 80 characters wide and 25 high. To display a character on the screen, a program loads the corresponding code into the memory location associated with its matrix cell. To put the image on the screen, the display system reads the entire matrix, translates into a serial data stream that scans across the monitor screen, and moves the data to the video output. In other words, it creates the exact bit-pattern that will appear on the screen on the fly, computing each nanosecond of the video signal in real time. From there, the signal is the monitor’s problem.

For your programs, writing characters to the screen is simply a matter of writing directly to screen memory. Consequently, this display technique is often called direct writing. It is the fastest way to put information on a computer screen. Character-mapping is also more versatile than teletype technology. Programs can push characters into any screen location in any order they please—top, bottom, left, or right, even lobbing one letter atop another, overwriting the transitory existence of each.

Once an advanced operating system such as Windows loads, however, your computer steps away from character-mapping. The operating system imposes itself between your programs and the BIOS. The operating system captures the characters your text-oriented programs attempt to fling directly at the screen. The operating system can then recompute the map, making it larger or smaller and, in the latter case, moving it to a designated area of the screen.

Direct Writing

This quick way of putting characters on the screen is often termed direct writing, because programs simply move the code assigned to a character directly to the memory location corresponding to that character’s screen position—a one-step process that requires only one microprocessor instruction.

Direct writing makes a specific demand from programs using it: They need to know the exact location of each screen memory address. For all applications to work on all computers, the addresses used by each system must be the same—or your software needs some means of determining what addresses your computer uses. In the first personal computers, the design engineers reserved two memory areas to serve as character buffers, one for color text and one for monochrome. These memory areas became standard for all computers, and your system still uses them for the text it displays on the screen while it is booting up. To determine which character buffer to use, your software can check the video mode flag at a special location in memory, which indicates the proper buffer. Although this dual-buffer feature remains part of every personal computer, it’s hardly necessary because of the universal use of color display systems.

Character Boxes

In text modes, the display memory addresses hold codes that have nothing to do with the shapes appearing on the monitor screen except as a point of reference. The actual patterns of each character that appears on the screen are stored in a special ROM chip called the character ROM that’s part of the video circuitry of the computer. The code value that defines the character is used by the video circuitry to look up the character pattern that matches it. The bit-pattern from the character ROM is scanned and sent to the screen to produce the final image.

Modern display adapters allow you to download your own fonts (typefaces) into onboard RAM that’s reserved from the same block that would serve as the character map. These downloaded fonts can be used as if they were located in ROM with the same ease of manipulation as ROM-based fonts. Downloaded fonts appear just the same, whether pushed on the screen through the teletype or direct-access technique.

Each onscreen character is made from an array of dots, much like the text output of a teletype or dot-matrix printer. Computer and display adapter manufacturers use several video standards to build individual characters out of different size dot arrays. The framework in which the dots of an individual character are laid out, called the character box, is a matrix like a crossword puzzle. The character box is measured by the number of dots or cells composing its width and its height. For example, Figure 19.1 shows a series of characters formed in character boxes measuring 15 by 9 cells.

computer

The text modes used by various early display standards all had their own, distinctive character boxes. The standard Video Graphics Array (VGA) text screen uses a 16-by-9 character box. Each character takes up a space on the screen measuring 16 dots high and 9 dots wide.

The last vestige of character mode display technology that remains under Windows is the DOS box, or command mode. You can select the height and width of the character box used in the command mode to adjust the size of the windows in which your character-based applications run in text mode using the properties sheet for command mode.

The size of the character box does not exactly describe how large each character is or how many dots are used in forming it. To improve readability, individual characters do not necessarily take up the entire area that a character box affords. For instance, text characters on most monochrome displays keep one row of dots above and one below those used by each character to provide visible separation between two adjacent lines of text on the screen.

Video Attributes

The character-mapped displays of most computer video systems do not store each letter adjacent to the next. Instead, each onscreen character position corresponds to every other byte in screen memory; the intervening bytes are used as attribute bytes. Even-numbered bytes store character information; odd bytes, attributes.

The attribute byte determines the highlighting or color of a displayed character that’s stored in the preceding memory byte. The codes used in monochrome and color displays are different. Monochrome characters are allowed the following attributes: normal, highlighted (brighter onscreen characters), underlined, and reverse-video characters (dark on light instead of the normal light on dark). The different attributes can be combined, although in the normal scheme of things highlighted reverse-video characters make the character background brighter instead of highlighting the character shape itself. These monochrome display attributes are listed in Table 19.1.

computer

Color systems store two individual character hues in the attribute byte. The first half of the byte (the most significant bits of the digital code of the byte) code the color of the character itself. The latter half of the attribute (the least significant bits) code the background color. Because four bits are available for storing each of these colors, this system can encode 16 foreground and 16 background colors for each character (with black and white considered two of these colors). In normal operation, however, one bit of the back ground color code indicates a special character attribute—blinking. This attribute allows any color combination to blink, but it also cuts the number of hues available for backgrounds in half (to eight colors, with all intensified color choices eliminated). When you or your software needs to be able to display all 16 background colors, a status bit allows the character-flashing feature to be defeated. Color display attributes are shown in Table 19.2.

computer

Because each character on the screen requires two bytes of storage, a full 80-character column by 25-character row of text (a total of 2000 characters) requires 4000 bytes of storage. In the basic computer monochrome video system, 16KB are allotted to store character information. The basic (and basically obsolete) color system reserves 64KB for this purpose.

Video Pages

The additional memory does not go to waste, however. It can be used to store more than one screen of text at a time, with each separate screen called a video page. Either basic video system is designed to quickly switch between these video pages so that onscreen images can be changed almost instantly. Switching quickly allows a limited degree of animation. The technique is so useful that even today’s most advanced 3D graphics boards use it, although with pictures instead of text.

Two-Dimensional Graphics

The only graphics available on the first computers were block graphics, akin in more than name to the first toys of toddlers, mere playthings that you wouldn’t want to use for serious work. The first computer graphics systems made television look good, which in any other context would be an insurmountable challenge to the imagination. The foundation of the new display systems—called bitmapped graphics—proved powerful enough that in a few years computer display quality not only equaled that of television, but computers were also used in making television images. The modern computer graphics system has taken a further step beyond and attempts to build a real (or real-looking) three-dimensional reality.

The development of computer graphics is best described as accumulation rather than evolution. Each new system builds upon the older designs, retaining full backward compatibility. Even the latest 3D graphics systems retain the ability to work with the first rudimentary block graphics. Just as you share genes with some of the lowest forms of life, such as bacteria, planaria, and politicians, your sleek new computer comes complete with state-of-the-art 1981 graphics technology.

Block Graphics

You don’t need a lot of computer power and an advanced operating system to put graphics on your screen, which is good because in the early years computers didn’t have a lot of power or decent operating systems. In fact, even teletypes that are able only to smash numbers and letters on paper can print primitive graphic images. By proper selection of characters, standing far from printouts, and squinting, you could imagine you saw pictures in some printouts (a triangle of text might vaguely resemble a Christmas tree, for example).

When computers operate like teletypes, their graphic output faces the same limitations as printouts—characters can only approximate real-world images. To try to improve matters, the designers of the original computer took advantage of the extra potential of storing characters as byte values. Because one byte can encode 256 different characters, and the alphabet and other symbols total far short of that number, the first computer’s designers assigned special characters to some of the higher-numbered bytes in its character set. Beyond dingbats and foreign language symbols, a few of the extra characters were reserved for drawing graphic images from discrete shapes and patterned blocks that partly or entirely fill in the character matrix.

When your computer is operating in text mode, such as in command mode, you can still create rough graphic images by strategically locating these character blocks on the screen so that they form larger shapes. Other extra characters comprise a number of single and double lines as well as corners and intersections of them to draw borders around text areas. The characters are building blocks of the graphic images, and consequently this form of graphics is termed block graphics. Figure 19.2 shows the block graphic characters in the standard computer character set.

computer

To a computer display system, block graphics are considered text and are handled exactly like ordinary text characters. All the text attributes are available to every character of block graphics, including all the available text colors, highlighting, and reverse video characteristics. The characters are also pushed onto the screen in text mode, which gives them high-speed potential, but they are available only in text mode or the Windows DOS box. Because they use the high-order ASCII characters—foreign territory for most seven-bit email systems—you cannot ordinarily use them for images in ordinary email.

Bitmapped Graphics

Windows marked the transition of the primary operating mode of computer display systems. From character-based displays, Windows ushered in the age of the bitmapped display. Bitmapped graphics improve the poor quality of block graphics by making the blocks smaller. The smaller the blocks making an image, the finer grain that can be shown, and therefore more detail. Physical aspects of the display system impose a distinct and unbreakable limit on how small each block can be—the size of the individual dots that make up the image on the video screen. The sharpest and highest-quality image that could be shown by any display system would individually control every dot or pixel on the screen.

The most straightforward way of handling the information to be displayed on such a screen is to assign some part of memory to each pixel, just as two bytes are given over to each character of a character-mapped display. In the computer scheme of things, because the data controlling each pixel is stored as one or more memory bits, this kind of display system is often called bitmapped graphics. Alternately, because each pixel or point on the video screen can be separately addressed through memory, this method of controlling the video display is often called all points addressable graphics or an APA display.

In the bitmapped graphics system, display memory stores an exact electronic representation of the onscreen image. It’s actually a time-slice of what you see—the software running on your computer is constantly sending new data into display memory to update the screen image. The memory temporarily stores or buffers the changes’ frame until they are read out as a complete image frame dozens of times per second. Because of this function, graphics display memory is often called the frame buffer.

As with character-mapped memory, programmers have their choice of methods to write bitmapped graphics to your monitor screen. The BIOS can do it, but Windows substitutes its own drivers for the purpose. Programs can also write directly to memory, but modern video systems make that chancy because each display system uses its own memory locations, display modes, and resolutions. Video drivers bridge these differences.

Bitmapped graphics hold the potential for being much sharper than block graphics. More pixels mean more detail. The number of dots on a screen and the ultimate number of pixels are many times the number of characters that are displayed on that same screen, from 64 to 126 times greater. However, bitmapped graphics imposes its own, interrelated penalties—memory usage and speed.

The amount of memory required by a graphics display system depends on two factors: the sharpness of the display image and the number of colors (or gray levels) to be displayed. Each increase in sharpness and number of colors means that your computer is putting more detail (more information) on its screen and storing more information in its display buffer. As a result, it must move around more information (more bytes), which means more work. And the harder your computer works, the longer it takes to complete its job.

Vector Graphics

Bitmapped graphics are sometimes termed raster graphics because the technology organizes the screen into a series of lines called a raster that’s continually scanned dozens of times a second. Although raster graphics are the basis of all computer displays—as well as today’s television and video systems—this is not the only way to put a computer image on a monitor. A completely different technique does not regularly scan the screen at all. Instead, it precisely controls the circuitry operating the horizontal and vertical deflection yokes. It doesn’t trace scan lines but instead draws figures the same way you would as a series of strokes of a paintbrush. To keep the screen lit, it constantly retraces the figures.

Because the signals controlling the monitor drive the electron beam in the CRT as a series of vectors, this image-making technique is usually termed vector graphics. Alternately, this kind of display system is sometimes called a stroker because of the kinship to drawing brushstrokes. Although not used on computers, the term pops up occasionally in the descriptions of expensive computerized workstations.

Resolution

The number that quantifies the possible sharpness of a video image is called resolution. It indicates how many individual pixels an image contains that your display system will spread across the width and height of the screen. Because your computer generates the image as an electrical signal completely independent from your computer monitor (it would make the same image even if your monitor wasn’t connected to the computer at all), physical properties of the monitor (such as its physical dimensions) play no part in resolution measurements. In other words, the number of pixels in an image does not vary with the size of the screen that it is displayed upon. Resolution is ex