Keyboard Scancodes

This page covers the codes that are transmitted from the keyboard to host via their carrier protocol. Note that protocol (the specifics of the connection) and scancodes (the data transmitted via that connection) are distinct parts of how a keyboard communicates. This topic is organised by the scancode set itself as major sections with subsections for individual implementations and notes on any idiosyncrasies or nuances.

Note

The keyboard diagrams used throughout this page are best viewed on desktop.

Contents

Full list

IBM 5251/5252 scancodes

These scancodes (no official name known) were believed to be introduced in 1977 with the IBM 5251 Display Station and 5252 Dual Display Station keyboards and reused by some later terminals and computers. Only some keys transmit make and break codes and the keyboard's typematic capability varies between implementation. These scancodes were typically transmitted via a specific parallel-based interface.

IBM 5251/5252 Typewriter Keyboard

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM System/23 Datamaster Keyboard (5322 & 5324)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM 5291/5292 Typewriter Keyboard

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM 3290-1/5085 scancodes

These scancodes (no official name known) were believed to be introduced in 1983 with the IBM 3290 Model 1 Information Panel and reused with the IBM 5080 Graphics System's 5085 Graphics Processor. They were the scancodes used by the original design of the IBM Converged Keyboard - Type 1 104-key Model Fs. These scancodes were typically transmitted via a specific parallel-based interface.

IBM 104-key Converged Keyboard (3290-1/5085)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM 24-key Numeric or Program Function Keypad (3290-1/5085)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM scancode set 1

IBM scancode set 1 (sometimes called "XT" scancodes) was the first of the 3 numbered scancode sets introduced by IBM in the 1980s. They were introduced with the IBM 5150 Personal Computer and also reused by IBM 5155 Portable Personal Computer and 5160 Personal Computer XT. Fully-compliant PS/2 keyboards should also be able to output set 1 scancodes when told to using the Select Alternate Scan Codes command. As standard, most keys should transmit make and break codes. These scancodes were typically transmitted via the serial-based 9-bit "XT-style" keyboard interface, but using the aforementioned command on compliant PS/2 keyboards will result in them being transmitted via the 11-bit "AT-style" keyboard interface (which wouldn't be compatible with an standard XT/XT-clone PC).

IBM Personal Computer Keyboard (5150, 5155 & 5160)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM Enhanced Keyboard (Personal Systems)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM PS/2 Host Connected Keyboard (Personal Systems)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM scancode set 2

IBM scancode set 2 (sometimes called "AT" scancodes) was chronologically the last of the three numbered scancode sets introduced by IBM in the 1980s. It was introduced in 1984 with the IBM 5170 Personal Computer AT and its Model F keyboard, which means despite being a lower number, IBM scancode set 3 actually predates it by several months. Sets 2 and 3 are also very similar in that they (at least) share alphabet, number row, core numeric keypad, Enter/Return key, Shift key, Tab key, and spacebar key codes. These scancodes are transmitted via the serial-based 11-bit "AT-style" keyboard interface. Set 2 scancodes and the AT-style interface were reused for PS/2's standard functionality albeit with a different (but compatible with a simple adapter) plug.

IBM Personal Computer AT Keyboard (5170)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM Enhanced Keyboard (Personal Systems)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM PS/2 Host Connected Keyboard (Personal Systems)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM scancode set 3

IBM scancode set 3 was chronologically the second of the three numbered scancode sets introduced by IBM in the 1980s. It was introduced by 1983 with the IBM 3270 Personal Computer and its 122-key Model F Converged Keyboard, beating the IBM Personal Computer AT Keyboard and IBM scancode set 2 to market. Sets 2 and 3 are very similar in that they (at least) share alphabet, number row, core numeric keypad, Enter/Return key, Shift key, Tab key, and spacebar key codes. These scancodes are transmitted via the serial-based 11-bit "AT-style" keyboard interface although set 3 isn't natively compatible with PC/AT, PS/2 and clone computers that aren't compatible with Linux or Windows NT 3.5 and later due to the differences outside the aforementioned similar codes and default make-and-break behaviour.

IBM 122-key Converged Keyboard (3179/3180/319X/3290-2/347X/348X/527X) & PS/2 Host Connected Keyboard (Personal Systems)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

IBM Enhanced Keyboard (3151/316X/319X/347X/348X)

Visualisation due to be loaded. If nothing appears, please ensure JavaScript is enabled.

Notes

Further reading & resources

External