KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q37617: Scan Codes for IBM and Compatible Keyboards

Article: Q37617
Product(s): See article
Version(s): 4.00 5.00 5.10 | 5.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 8-NOV-1988

Below are the scan codes for IBM and compatible keyboards. All scan
codes are in hexadecimal. See the "IBM PC Technical Reference" for more
details.

The scan codes are as follows:

83 key (PC,PC/XT)       84 key (PC/AT)        101/102 key (PC/AT PS/2)

Key     Scan Code       Key     Scan Code       Key     Scan Code

ESC         01          KP ESC      01          ESC         01
1           02          1           02          1           02
2           03          2           03          2           03
3           04          3           04          3           04
4           05          4           05          4           05
5           06          5           06          5           06
6           07          6           07          6           07
7           08          7           08          7           08
8           09          8           09          8           09
9           0A          9           0A          9           0A
0           0B          0           0B          0           0B
-           0C          -           0C          -           0C
=           0D          =           0D          =           0D
BACKSPACE   0E          BACKSPACE   0E          BACKSPACE   0E
TAB         0F          TAB         0F          TAB         0F
Q           10          Q           10          Q           10
W           11          W           11          W           11
E           12          E           12          E           12
R           13          R           13          R           13
T           14          T           14          T           14
Y           15          Y           15          Y           15
U           16          U           16          U           16
I           17          I           17          I           17
O           18          O           18          O           18
P           19          P           19          P           19
[           1A          [           1A          [           1A
]           1B          ]           1B          ]           1B
RETURN      1C          RETURN      1C          RETURN      1C
CTRL        1D          CTRL        1D          L CTRL      1D
A           1E          A           1E          A           1E
S           1F          S           1F          S           1F
D           20          D           20          D           20
F           21          F           21          F           21
G           22          G           22          G           22
H           23          H           23          H           23
J           24          J           24          J           24
K           25          K           25          K           25
L           26          L           26          L           26
;           27          ;           27          ;           27
'           28          '           28          '           28
`           29          ESC         29          `           29
L SHIFT     2A          L SHIFT     2A          L SHIFT     2A
Z           2C          Z           2C          Z           2C
X           2D          X           2D          X           2D
C           2E          C           2E          C           2E
V           2F          V           2F          V           2F
B           30          B           30          B           30
N           31          N           31          N           31
M           32          M           32          M           32
,           33          ,           33          ,           33
.           34          .           34          .           34
/           35          /           35          /           35
R SHIFT     36          R SHIFT     36          R SHIFT     36
PRT SCR     37          PRT SCR     37          KP *        37
ALT         38          ALT         38          ALT         38
Space       39          Space       39          Space       39
CAPS LOCK   3A          CAPS LOCK   3A          CAPS LOCK   3A
F1          3B          F1          3B          F1          3B
F2          3C          F2          3C          F2          3C
F3          3D          F3          3D          F3          3D
F4          3E          F4          3E          F4          3E
F5          3F          F5          3F          F5          3F
F6          40          F6          40          F6          40
F7          41          F7          41          F7          41
F8          42          F8          42          F8          42
F9          43          F9          43          F9          43
F10         44          F10         44          F10         44
NUM LOCK    45          NUM LOCK    45          NUM LOCK    45
SCROLL LOCK 46          SCROLL LOCK 46          SCROLL LOCK 46
KP 7        47          KP 7        47          KP 7        47
KP 8        48          KP 8        48          KP 8        48
KP 9        49          KP 9        49          KP 9        49
KP -        4A          KP -        4A          KP -        4A
KP 4        4B          KP 4        4B          KP 4        4B
KP 5        4C          KP 5        4C          KP 5        4C
KP 6        4D          KP 6        4D          KP 6        4D
KP +        4E          KP +        4E          KP +        4E
KP 1        4F          KP 1        4F          KP 1        4F
KP 2        50          KP 2        50          KP 2        50
KP 3        51          KP 3        51          KP 3        51
KP 0        52          KP 0        52          KP 0        52
KP .        53          KP .        53          KP .        53
                        Sys Req     54          F11         57
                                                F12         58
                                                R CTRL      E0 10
                                                KP /        E0 36
                                                R ALT       E0 38
                                                RIGHT ARROW E0 40
                                                HOME        E0 47
                                                UP ARROW    E0 48
                                                PAGE UP     E0 49
                                                LEFT ARROW  E0 4B
                                                END         E0 4F
                                                DOWN ARROW  E0 50
                                                PAGE DOWN   E0 51
                                                INSERT      E0 52
                                                DELETE      E0 53
                                                KP ENTER    E0 1C
                                                PAUSE       E1 10 45
                                                PRINT SCR   E0 2A E037

(Source : Norton's Guide to the IBM PC and PS/2)

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.