Scancode

Scancode

A scancode (or scan code) is the data that "most" computer keyboards send to a computer to report which keys have been pressed. A number, or sequence of numbers, is assigned to each key on the keyboard.

Mapping key positions by row and column requires less complex computer hardware; therefore, in the past, using software or firmware to translate the scancodes to text characters was less expensive than wiring the keyboard by text character.Fact|date=February 2007 This cost difference is not as profound as it used to be. However, many types of computers still use their traditional scancodes to maintain backward compatibility.

Some keyboard standards include a scancode for each key being pressed and a different one for each key being released. In addition, many keyboard standards (for example, IBM PC compatible standards) allow the keyboard itself to generate "typematic" repeating keys by having the keyboard itself generate the pressed-key scancode repeatedly while the key is held down, with the release scancode sent once when the key is released.

cancode sets

USB

USB keyboards use a new set of scancodes, mostly specified in the USB standard. All computers that recognize USB keyboards recognize these new scancodes.

PC compatibles

Scancodes on IBM PC compatible keyboards are sets of 1 to 3 bytes which are sent by the keyboard. Most character keys have a single byte scancode; keys that perform special functions have 2-byte or 3-byte scancodes, usually beginning with the byte (in hexadecimal) E0, E1, or E2. In addition, a few keys send longer scancodes, effectively emulating a series of keys to make it easier for different types of software to process.

PC-compatibles have used three scancode sets. The most common are the "XT" ("set 1") scancodes, used by the IBM PC XT and earlier; and the "AT" ("set 2") scancodes, used by the IBM PC AT and later, keyboards including PS/2 keyboards. There is also a PS/2-specific "set 3" that is rarely used. [http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html Keyboard scancodes] ( [http://www.win.tue.nl/~aeb/linux/kbd/scancodes-10.html section 10, "Keyboard internal scancodes"] ), Andries Brouwer. Version 1.2e, 2004-05-20, accessed 2006-11-15.]

On all PC-compatibles with IBM PC AT or PS/2 keyboards, the computer translates AT (set 2) scancodes into XT (set 1) scancodes for backwards compatibility unless sent a code to do otherwise. Therefore, whether an engineer will encounter AT scancodes or XT scancodes on a modern PC-compatible depends on how the keyboard is being accessed.

Example PC compatible scancodes

References

ee also

* Dead key
* Meta key
* Keyboard layout
* Keyboard technology
* Typeahead — technique that allows one to type in characters even if the system is currently busy and won't give visual feedback

External links

* [http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html Keyboard scancodes] - written by Andries Brouwer
* [http://www.barcodeman.com/altek/mule/scandoc.php PC Keyboard Scan Codes] - background information on scancodes


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Scancode — Ein Scancode ist in der Computertechnik eine Nummer, die von der Tastatur eines Rechners an diesen gesendet wird, wenn eine Taste gedrückt oder losgelassen wird. Inhaltsverzeichnis 1 PC/XT Tastatur 2 PC/AT Tastatur 3 MF2 Tastatur …   Deutsch Wikipedia

  • scancode — ● ►en n. m. ►KEY Code renvoyé par le clavier, indiquant quelle touche vient d être frappée. Ce n est pas le caractère écrit sur la touche, mais l emplacement physique de la touche sur le clavier. On utilise ensuite une table qui permet de faire… …   Dictionnaire d'informatique francophone

  • Anatomische Tastatur — Standard PC Tastatur mit deutscher Tastenbelegung Laptoptastatur mit deutscher Belegung …   Deutsch Wikipedia

  • Computertastatur — Standard PC Tastatur mit deutscher Tastenbelegung Laptoptastatur mit deutscher Belegung …   Deutsch Wikipedia

  • Einfg — Standard PC Tastatur mit deutscher Tastenbelegung Laptoptastatur mit deutscher Belegung …   Deutsch Wikipedia

  • Ergonomische Tastatur — Standard PC Tastatur mit deutscher Tastenbelegung Laptoptastatur mit deutscher Belegung …   Deutsch Wikipedia

  • Pos1 — Standard PC Tastatur mit deutscher Tastenbelegung Laptoptastatur mit deutscher Belegung …   Deutsch Wikipedia

  • Pos 1 — Standard PC Tastatur mit deutscher Tastenbelegung Laptoptastatur mit deutscher Belegung …   Deutsch Wikipedia

  • Schwarzschrifttastatur — Standard PC Tastatur mit deutscher Tastenbelegung Laptoptastatur mit deutscher Belegung …   Deutsch Wikipedia

  • Virtual Keyboard — Standard PC Tastatur mit deutscher Tastenbelegung Laptoptastatur mit deutscher Belegung …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”