Keyboard functionality

Does anyone know if the physical design of the Control and Alt keys is different than other keys on the keyboard?

Specifically, why is it that when a function is remapped to, say the right control key, that function is not executed until the Control key is pressed AND RELEASED rather than simply once it is depressed?

I get the impression that these keys operate differently than other keys, but am looking for a more technical description of why they bahave the way they do…

Hope this makes sense!



The shift, capslock, alt, control and numlock keys are processed quite differently by the keyboard hardware. A regular key generates a code for that key that includes the state of the “shift” keys. So the key with the “4” in it produces its own code plus whether the shift, etc. keys are down or up. If the shift key is down, another layer of decoding can then be used to infer you really pressed “$”. Simple programs can also be written to just check if any given shift key (which differentiates the left and right ones) is currently up or down. (I’ve written them.) There’s also a code generated when a regular key is lifted, but not too many programs pay attention to that.

A book on assembly language programming for the IBM PC will tell you more. Other types of computers work in similar ways. (And you can even have “meta” and other shift-like keys.)

In X-windows, you can set up behavior for programs based on quite complicated combinations of shift+key presses or mouse clicks/drags. (In MS-Windows you are usually stuck with the settings of the program, unless you use an auxillary program.)