![]() | Keyboard Scan Codes | ![]() |
![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() | ||
![]() | ||
![]() |
You can now determine specific Keyboard Scancodes and sequences without the need to look them up individually in a table and assemble them by hand. Just click on the keys and cut and paste the results. The Keyboard Emulator is here
It’s easy to get confused over scancodes because the AT scancodes used at the hardware level are converted by the PC Bios into XT codes. If you are an engineer looking at the keyboard bus lines with a ’scope or 'Reverse Mule' analysis unit you will likely see AT style scancodes. But if you are a programmer you will probably be dealing with XT codes. This is to maintain backward compatibility with the earliest PCs of the mid 1980s. If anyone knows of any equipment still using XT codes at the hardware level please let me know.
Since this page was first written six new keys have been added to the original keyboards. The scancodes for these keys can be found at the foot of this page. The Mule can emulate ALL the new keys.
All the scancodes published here have been verified with The Shadow Mule and are known to be accurate. Data published elsewhere is often seen to contain errors. Please do not copy this data into another medium or web site. It is maintained up to date here and we strictly enforce our copyrights. We are happy for any site to link here.
The PC keyboard interface is designed so the system software has maximum flexibility in defining certain keyboard operations. This is accomplished by having the keyboard return scancodes rather than ASCII codes. Each key generates a 'make' scancode when pressed and a 'break' scancode when released. The computer system interprets the scancodes to determine what operation it is to perform. For historical compatibility reasons computers can employ different sets of scancodes for different purposes. Earlier PC computers tend to use the XT scancode set. Current PC computers tend to use the AT scancode set. The MF1, MF2 and MF3 sets are alternatives, similar in many respects to the XT and AT sets. The table below shows the scancodes generated when a key is pressed- the 'make' code. The 'break' code may be derived from the 'make' code as described later. Notice that scancodes may consist of a single or several bytes.
Many keyboard scancode tables published are not completely accurate. Confusion arises between scancodes issued by the keyboard hardware and the scancodes appearing in the keyboard buffer. The scancodes presented here are those actually sent by the keyboard hardware. The computer BIOS may translate the code for compatibility reasons. For example, the XT scancode set was first used in the original IBM PC computer. Other IBM computers and terminals used a different scancode set. Apparently IBM tried to bring the PC into line with its other products when the IBM PC/AT was launched. The keyboard for that machine used a scancode set virtually identical to other IBM machines. However to maintain compatibility with earlier PC software the BIOS for the AT machines converted the AT scancodes into the earlier XT scancodes. At the current time (June 1995) this system of code conversion in the BIOS persists. The code you read from the keyboard buffer is not necessarily the same code transmitted from the keyboard.
The 'break' code for XT style computers is the 'Make' code OR’d with the hexadecimal value 80. (If you are unfamiliar with hexadecimal numbers then simply change the first character of the scancode thus: Change 0 to 8, 1 to 9, 2 to A, 3 to B, 4 to C, 5 to D, 6 to E, 7 to F)
For example the scancodes generated by pressing and releasing the Escape key (Key Number 110) are 01 81
Most PC’s made since about 1989 use keyboards that generate AT scancodes (Though the codes may be converted to XT scancodes in the BIOS). The 'break' code for AT class scancodes is simply the 'make' code preceded by hex F0. For example the scancodes generated when the Escape key is pressed and released are 76 F0 76.
If the keyboard’s buffer overflows it sends a special scancode to the computer. This generally causes the computer to sound a warning beep. Altek Mule(tm) users may issue this code if they want to sound the beep to draw the operators attention. For computers using AT scancodes the code is 00. (For obsolete PCs using XT scancodes the code was hex FF)
Key Num | XT | AT | MF1 | MF2 | MF3 |
---|---|---|---|---|---|
1 | 29 | 0E | 29 | 0E | 0E |
2 | 02 | 16 | 02 | 16 | 16 |
3 | 03 | 1E | 03 | 1E | 1E |
4 | 04 | 26 | 04 | 26 | 26 |
5 | 05 | 25 | 05 | 25 | 25 |
6 | 06 | 2E | 06 | 2E | 2E |
7 | 07 | 36 | 07 | 36 | 36 |
8 | 08 | 3D | 08 | 3D | 3D |
9 | 09 | 3E | 09 | 3E | 3E |
10 | 0A | 46 | 0A | 46 | 46 |
11 | 0B | 45 | 0B | 45 | 45 |
12 | 0C | 4E | 0C | 4E | 4E |
13 | 0D | 55 | 0D | 55 | 55 |
15 | 0E | 66 | 0E | 66 | 66 |
16 | 0F | 0D | 0F | 0D | 0D |
17 | 10 | 15 | 10 | 15 | 15 |
18 | 11 | 1D | 11 | 1D | 1D |
19 | 12 | 24 | 12 | 24 | 24 |
20 | 13 | 2D | 13 | 2D | 2D |
21 | 14 | 2C | 14 | 2C | 2C |
22 | 15 | 35 | 15 | 35 | 35 |
23 | 16 | 3C | 16 | 3C | 3C |
24 | 17 | 43 | 17 | 43 | 43 |
25 | 18 | 44 | 18 | 44 | 44 |
26 | 19 | 4D | 19 | 4D | 4D |
27 | 1A | 54 | 1A | 54 | 54 |
28 | 1B | 5B | 1B | 5B | 5B |
* 29 | 2B | 5D | 2B | 5D | 5C |
30 | 3A | 58 | 3A | 58 | 14 |
31 | 1E | 1C | 1E | 1C | 1C |
32 | 1F | 1B | 1F | 1B | 1B |
33 | 20 | 23 | 20 | 23 | 23 |
34 | 21 | 2B | 21 | 2B | 2B |
35 | 22 | 34 | 22 | 34 | 34 |
36 | 23 | 33 | 23 | 33 | 33 |
37 | 24 | 3B | 24 | 3B | 3B |
38 | 25 | 42 | 25 | 42 | 42 |
39 | 26 | 4B | 26 | 4B | 4B |
40 | 27 | 4C | 27 | 4C | 4C |
41 | 28 | 52 | 28 | 52 | 52 |
** 42 | 2B | 5D | 2B | 5D | 53 |
43 | 1C | 5A | 1C | 5A | 5A |
44 | 2A | 12 | 2A | 12 | 12 |
** 45 | 56 | 61 | 56 | 61 | 13 |
46 | 2C | 1A | 2C | 1A | 1A |
47 | 2D | 22 | 2D | 22 | 22 |
48 | 2E | 21 | 2E | 21 | 21 |
49 | 2F | 2A | 2F | 2A | 2A |
50 | 30 | 32 | 30 | 32 | 32 |
51 | 31 | 31 | 31 | 31 | 31 |
52 | 32 | 3A | 32 | 3A | 3A |
53 | 33 | 41 | 33 | 41 | 41 |
54 | 34 | 49 | 34 | 49 | 49 |
55 | 35 | 4A | 35 | 4A | 4A |
57 | 36 | 59 | 36 | 59 | 59 |
58 | 1D | 14 | 1D | 14 | 11 |
60 | 38 | 11 | 38 | 11 | 19 |
61 | 39 | 29 | 39 | 29 | 29 |
62 | E038 | E011 | E038 | E011 | 39 |
64 | E01D | E014 | E01D | E014 | 58 |
75 | E052 | E070 | E052 | E070 | 67 |
76 | E053 | E071 | E053 | E071 | 64 |
79 | E04B | E06B | E04B | E06B | 61 |
80 | E047 | E06C | E047 | E06C | 6E |
81 | E04F | E069 | E04F | E069 | 65 |
83 | E048 | E075 | E048 | E075 | 63 |
84 | E050 | E072 | E050 | E072 | 60 |
85 | E049 | E07D | E049 | E07D | 6F |
86 | E051 | E07A | E051 | E07A | 6D |
89 | E04D | E074 | E04D | E074 | 6A |
90 | 45 | 77 | 45 | 77 | 76 |
91 | 47 | 6C | 47 | 6C | 6C |
92 | 4B | 6B | 4B | 6B | 6B |
93 | 4F | 69 | 4F | 69 | 69 |
95 | E035 | E04A | E035 | E04A | 77 |
96 | 48 | 75 | 48 | 75 | 75 |
97 | 4C | 73 | 4C | 73 | 73 |
98 | 50 | 72 | 50 | 72 | 72 |
99 | 52 | 70 | 52 | 70 | 70 |
100 | 37 | 7C | 37 | 7C | 7E |
101 | 49 | 7D | 49 | 7D | 7D |
102 | 4D | 74 | 4D | 74 | 74 |
103 | 51 | 7A | 51 | 7A | 7A |
104 | 53 | 71 | 53 | 71 | 71 |
105 | 4A | 7B | 4A | 7B | 84 |
106 | 4E | 79 | 4E | 79 | 7C |
108 | E01C | E05A | E01C | E05A | 79 |
110 | 01 | 76 | 01 | 76 | 08 |
112 | 3B | 05 | 3B | 05 | 07 |
113 | 3C | 06 | 3C | 06 | 0F |
114 | 3D | 04 | 3D | 04 | 17 |
115 | 3E | 0C | 3E | 0C | 1F |
116 | 3F | 03 | 3F | 03 | 27 |
117 | 40 | 0B | 40 | 0B | 2F |
118 | 41 | 83 | 41 | 83 | 37 |
119 | 42 | 0A | 42 | 0A | 3F |
120 | 43 | 01 | 43 | 01 | 47 |
121 | 44 | 09 | 44 | 09 | 4F |
122 | 57 | 78 | 57 | 78 | 56 |
123 | 58 | 07 | 58 | 07 | 5E |
124 | E02AE037 | E012E07C | E02AE037 | E012E07C | 57 |
125 | 46 | 7E | 46 | 7E | 5F |
126 | E11D45E1 9DC5 | 1477F014 F077 | E11D45E1 9DC5 | E11477E1 F014F077 | 62 |
When the 'Windows 95' operating system was introduced three new keys were added to the PC keyboard. These keys have been retained for all subsequent operating systems and PCs. They are the two 'Flying Windows' keys and the 'Pop Up Menu' key. These keys may be emulated by The Mule in Scancode Mode just like any other key. The appropriate 'make' and 'break' scancodes are shown below...
Make |
Break |
|
Left Flying Window |
E0 1F |
E0 F0 1F |
Right Flying Window |
E0 27 |
E0 F0 27 |
Pop Up Menu |
E0 2F |
E0 F0 2F |
Some computers are appearing with 3 extra Power Management keys. These keys are used to support OnNow architecture PCs. (OnNow is a term for a PC that is always on but appears off and responds immediately to user or other requests.) The three keys are Power, Sleep and Wakeup. These keys are non repeating keys. In other words the 'Make' scancode is sent once regardless of how long the key is held down. These keys may be emulated by The Mule in Scancode Mode just like any other key. The appropriate 'make' and 'break' scancodes are listed below...
Make |
Break |
|
Power |
E0 37 |
E0 F0 37 |
Sleep |
E0 3F |
E0 F0 3F |
Wake Up |
E0 5E |
E0 F0 5E |
Altek Instruments have designed and built a general purpose, low cost PC interface which generates Keyboard Scancodes. Any key or combination of keys may be emulated thus enabling any applications program to interact with RS232 peripheral devices. We call it The Mule™.
Altek Instruments Ltd have a range of products designed for the data collection/automatic ID industries.
![]() | |
![]() | |
Top Home | © Lee Allen, 2013 |