Date: Wed, 18 Sep 2002 07:38:26 -0700
From: RP Henry
X-Mailer: Mozilla 4.75 [en] (Win98; U)
Subject: Re: How does a computer keyboard generate ASCII code or signals?
"Dr. M Gani" wrote:
> Hello everyone. I am an old man, with a secret envy for you young
> people with the mesmerizing skills of cybernetic technology. The
> ignorant users like me need dumb ways of doing things, and you people
> have the exciting job of making complex designs behind the user
> I apologize to you all in case this sounds like an advertisement. As
> an economist and business consultant, I think that there is a large
> latent demand for easier-to-use computer keyboards. So if anyone has
> experience of designing keyboards, please discuss how the keyboard
> sends signals to the computer. If (as I suspect) this is too elmentary
> and boring stuff for this board, please advise me privately. Also,
> please let me know if you can design a new keyboard with, say, 56
> character keys, each of which will generate 4 different characters (eg
> with pressing the key, shift+key, specialkey1+key and
> specialkey2+key). I know I can press (alt+ASCII number) to generate
> any character, but I find this user-hostile. We old idiots would much
> rather shell out a few bucks to avoid learning complex things you
> enjoy, but we want the comfort you make possible by your magical
> machines!! I am sorry we cannot offer anything exciting other than the
> nasty thing known as money.
> All of you have fun.
> M Gani
A microcontroller in the keyboard continuously scans the keys faster
than most people can type. Whenever a key is pressed, a "scan code" is
sent to the computer on a simple dedicated serial port on the computer
motherboard. When the key is released, a different code is sent,
typically the original "press" code plus 80 hex, or the press code
preceded by a code marker like F0. The motherboard hardware and bios
keep track of which keys are currently pressed in a list in a standard
location, and applications can do what they like with them.
The scan codes are not ascii, although they are pretty standard for the
family of "IBM-PC" compatibles. Some keys cause a long string of scan
codes: my favorite is "Print Screen", whcih causes a PS/2 compatible
keyboard to send E0 2A E0 37 on press, and E0 B7 E0 AA on release.
There are some