Up ] Docs Home ]

Values for keyboard make/break (scan) code

Back ] Next ]

Code Key Code Key Code Key Code Key
00h 10h Q 20h D 30h B

01h

Esc

11h

W

21h

F

31h

N
02h 1 ! 12h E 22h G 32h M
03h 2 @ 13h R 23h H 33h , <
04h 3 # 14h T 24h J 34h . >
05h 4 $ 15h Y 25h K 35h / ?
06h 5 % 16h U 26h L 36h Right Shift
07h 6 ^ 17h I 27h ; : 37h Grey *
08h 7 & 18h O 28h ' " 38h Alt
09h 8 * 19h P 29h ` ~ 39h SpaceBar
0Ah 9 ( 1Ah [ { 2Ah Left Shift 3Ah CapsLock
0Bh 0 ) 1Bh ] } 2Bh \ | 3Bh F1
0Ch - _ 1Ch Enter 2Ch Z 3Ch F2
0Dh = + 1Dh Ctrl 2Dh X 3Dh F3
0Eh Backspace 1Eh A 2Eh C 3Eh F4
0Fh Tab 1Fh S 2Fh V 3Fh F5

Code Key Code Key Code Key Code Key
40h F6 50h Down Arrow 60h 70h Del-> (delete forward)

41h

F7

51h

Page Down

61h

71h

42h F8 52h Ins 62h 72h CrSel
43h F9 53h Del 63h F16 73h <delta>
44h F10 54h SysReq 64h F17 74h ExSel Enter
45h NumLock 55h F11 65h F18 75h
46h ScrollLock 56h left \ left | 66h F19 76h Clear
47h Home 57h F11 {*1} 67h F20 77h Joystick But1 {*2}
48h Up Arrow 58h F12 68h F21 Fn 78h Joystick But2 {*2}
49h Page Up 59h F15 {*1} 69h F22 79h Joystick Right {*2}
4Ah Grey - 5Ah PA1 6Ah F23 7Ah Joystick Left {*2}
4Bh Left Arrow 5Bh F13 LWin 6Bh F24 7Bh Joystick Up {*2}
4Ch Keypad 5 5Ch F14 RWin 6Ch 7Ch Joystick Down {*2}
4Dh Right Arrow 5Dh F15 Menu 6Dh EraseEOF 7Dh Right mouse {*2}
4Eh Grey + 5Eh 6Eh 7Eh Left mouse {*2}
4Fh End 5Fh 6Fh Copy/Play 7Fh

Non-Key Codes
Code Key
00h kbd buffer full
AAh self-test complete
E0h prefix code
E1h prefix code
F0h prefix code (key break)
FAh ACK
FCh diag failure (MF-kbd)
FDh diag failure (AT-kbd)
FEh RESEND
FFh kbd error/buffer full

Note:

Scan codes 56h-E1h are only available on the extended (101/102-key) keyboard and Host Connected (122-key) keyboard; scan codes 5Bh-5Dh are only available on the 122-key keyboard and the Microsoft Natural Keyboard; scan codes 5Eh-76h are only available on the 122-key keyboard.
In the default configuration, break codes are the make scan codes with the high bit set; make codes 60h,61h,70h, etc. are not available because the corresponding break codes conflict with prefix codes (code 2Ah is available because the self-test result code AAh is only sent on keyboard initialization). An alternate keyboard configuration can be enabled on AT and later systems with enhanced keyboards, in which break codes are the same as make codes, but prefixed with an F0h scan code.
Prefix code E0h indicates that the following make/break code is for a "gray" duplicate to a key which existed on the original PC keyboard; prefix code E1h indicates that the following make code has no corresponding break code (currently only the Pause key generates no break code).
The Microsoft Natural Keyboard sends make codes 5Bh, 5Ch, and 5Dh (all with an E0h prefix) for the Left Windows, Right Windows, and Menu keys on the bottom row.
The European "Cherry G81-3000 SAx/04" keyboard contains contacts for four additional keys, which can be made available by a user modification; the three new keys located directly below the cursor pad's Delete, End, and PgDn keys send make codes 66h-68h (F19-F21); the fourth new key, named <delta>, sends make code 73h.
The SysReq key is often labeled SysRq.
The "Accord" ergonomic keyboard with optional touchpad (no other identification visible on keyboard or in owner's booklet) has an additional key above the Grey- key marked with a left-pointing triangle and labeled "Fn" in the owner's booklet which returns scan codes E0h 68h on make and E0h E8h on break.
The "Preh Commander AT" keyboard with additional F11-F22 keys treats F11-F20 as Shift-F1..Shift-F10 and F21/F22 as Ctrl-F1/Ctrl-F2; the Eagle PC-2 keyboard with F11-F24 keys treated those additional keys in the same way.
{*1} The "Cherry G80-0777" keyboard has additional F11-F15 keys which generate make codes 55h-59h; some other extended keyboards generate codes 55h and 56h for F11 and F12, which cannot be managed by standard DOS keyboard drivers.
{*2} The Schneider/Amstrad PC1512 PC keyboards contain extra keys, a mouse, and a digital joystick, which are handled like extra keys. The joystick's motion scancodes are converted into standard arrow keys by the BIOS, and the joystick and mouse button scan codes are converted to FFFFh codes in the BIOS keyboard buffer (see CMOS 15h"AMSTRAD").

See Also:

#00602 at INT 16/AX=6F07h,#03214 at INT 4A/AH=05h