The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Saturday, February 18, 2006

“Now THAT'S a keyboard!”

Dan Lyke linked to several manual typewriters used as computer keyboards (the ElectriClerk perhaps being the coolest of the three, going all Brazil with an old Macintosh SE). As I'm reading about the typewriter-keyboard conversion, I was struck that the person doing it might now know how keyboards work:

Like I said earlier, each key is a connection between two terminals. Some terminals have lots of keys connected to them. For example, connecting terminal 4 and terminal 19 might produce “A” but connecting terminal 9 and terminal 19 might produce “F”. Since 1-13 always connected to 14-26 and vice versa (i.e. no terminal from 1 to 13 connects to any other terminal from 1 to 13), I arbitrarily decided that the levers would all connect to 1 13 and the crossbar would connect to 14-26.

putting it together

A keyboard is basically a matrix of switches. Here's the schematic of the keyboard used on the Color Computer 2 (a very simple 53-key keyboard):

[Schematic of Color Computer 2 keyboard interface]

(“EN” is the Enter key, “CL” is the Clear key, “BR” is the Break key, “SP” is the Spacebar and “SH” are the Shift keys)

You would write a “0” to each column (so, to read the rightmost column, you would write a value of 254 (in binary—11111110) and then read the rows. In each case where there is a 0 there is a key being held down along that row. So, again, for the right most column, if you read in 187 (or 10111011 in binary) the Shift key (either one, since they're wired together) and the “W” key are being pressed.

There's a bit more to it than that—the code to read the keyboard would scan through each column, and it would have to know to flag the Shift key as being up or down, and once it detected a key (or two) being down, it would have to pause for a bit, then re-scan for that key (which is called “debouncing”—as you press the key the electrical contact may switch on and off as the key is being hit)—but that's basically how all computer keyboards work (more or less—your standard PC keyboard these days are very simple computers themselves that scan the keyboard matrix and send a standardized code for each key to your computer).

Obligatory Picture

[“I am NOT a number, I am … a Q-CODE!”]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site:, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.