User`s guide

Scan Code
Processing
Note: The infonnation that follows gives an
overview of how scan codes are
generated at the keyboard. Refer to the
^propriate IBM Technical Reference
Manual for detailed information on
these topics.
Undemeath the keyboard is a grid of electrical circuitry.
When a key is pressed, contact is made with the grid,
creating a closed circuit. The keyboard microprocessor
uses electrical current to constantly scan this grid, even
when the keyboard is not in use. Once a closed circuit is
detected, the microprocessor encodes the position of the
keypress, translates the keypress to an IBM scan code,
and transmits this scan code to the host computer. A scan
code,
sometimes called a "key code", is a numerical
value that uniquely identifies each keyboard key.
Each key or keyswitch on the computer is represented by
two scan codes: a "down" scan code (make code), sent
when a key is pressed, and an "up" scan code {break
code),
sent when the key is released. For example, on the
IBM PC/XT and PS/2 Models 25 and 30, keyswitch
number
"1",
the Escape key, produces scan code 01
hexadecimal (hex) on make and scan code 81 hex on
break. Break codes are formed by adding 80 hex to the
make code.
The IBM AT and PS/2 Models 50,60, and 80 use a
different set of scan codes than the PC/XT. For example,
keyswitch number
"1"
on the AT produces scan code 76
hex on make and scan code
FO
76 hex on break. AT
break codes are formed by preceding the make code with
FO
hex.
Page A-2