
	       Scan Codes and Keyboard Character Codes


		       Compiled	and Annotated by

			   William C. Parke
                         (c) 1985,'86,'87,'88

		  Send comments	or corrections to:

			  William C. Parke
			  1820 S Street	NW
		       Washington, D.C.	20009



----------------------------------------------------------------------------

The following lists the	keyboard keystrokes and	the scan code/character	code
combinations returned through Int 16h (values in hex):

		     Shift		 Ctrl		     Alt
+-----------------+-------------------+-------------------+------------------+
Esc   01-1B	   Esc	 01-1B	       Esc   01-1B (ESC)   Esc	 -- [01-00]
1     02-31	   !	 02-21	       1     --		   1	 78-00
2     03-32	   @	 03-40	       2     03-00 (NUL)   2	 79-00
3     04-33	   #	 04-23	       3     --		   3	 7A-00
4     05-34	   $	 05-24	       4     --		   4	 7B-00
5     06-35	   %	 06-25	       5     --		   5	 7C-00
6     07-36	   ^	 07-5E	       6     07-1E (RS )   6	 7D-00
7     08-37	   &	 08-26	       7     --		   7	 7E-00
8     09-38	   *	 09-2A	       8     --		   8	 7F-00
9     0A-39	   (	 0A-28	       9     --		   9	 80-00
0     0B-30	   )	 0B-29	       0     --		   0	 81-00
-     0C-2D	   _	 0C-5F	       -     0C-1F (US )   -	 82-00
=     0D-3D	   +	 0D-2B	       =     --		   =	 83-00
Bsp   0E-08	   Bsp	 0E-08	       Bsp   0E-7F (DEL)   Bsp	 -- [0E-00]
Tab   0F-09	   Tab	 0F-09	       Tab   --	[94-00]	   Tab	 -- [A5-00]
q     10-71	   Q	 10-51	       q     10-11 (DC1)   q	 10-00
w     11-77	   W	 11-57	       w     11-17 (ETB)   w	 11-00
e     12-65	   E	 12-45	       e     12-05 (ENQ)   e	 12-00
r     13-72	   R	 13-52	       r     13-12 (DC2)   r	 13-00
t     14-74	   T	 14-54	       t     14-14 (DC4)   t	 14-00
y     15-79	   Y	 15-59	       y     15-19 (EM )   y	 15-00
u     16-75	   U	 16-55	       u     16-15 (NAK)   u	 16-00
i     17-69	   I	 17-49	       i     17-09 (HT )   i	 17-00
o     18-6F	   O	 18-4F	       o     18-0F (SI )   o	 18-00
p     19-70	   P	 19-50	       p     19-10 (DLE)   p	 19-00
[     1A-5B	   {	 1A-7B	       [     1A-1B (ESC)   [	 -- [1A-00]
]     1B-5D	   }	 1B-7D	       ]     1B-1D (GS )   ]	 -- [1B-00]
Rtn   1C-0D	   Rtn	 1C-0D	       Rtn   1C-0A (LF )   Rtn	 -- [1C-00]
Ctl   **	   Ctl	 **	       Ctl   **		   Ctl	 **
a     1E-61	   A	 1E-41	       a     1E-01 (SOH)   a	 1E-00
s     1F-73	   S	 1F-53	       s     1F-13 (DC3)   s	 1F-00
d     20-64	   D	 20-44	       d     20-04 (EOT)   d	 20-00
f     21-66	   F	 21-46	       f     21-06 (ACK)   f	 21-00
g     22-67	   G	 22-47	       g     22-07 (BEL)   g	 22-00
h     23-68	   H	 23-48	       h     23-08 (BS )   h	 23-00
j     24-6A	   J	 24-4A	       j     24-0A (LF )   j	 24-00
k     25-6B	   K	 25-4B	       k     25-0B (VT )   k	 25-00
l     26-6C	   L	 26-4C	       l     26-0C (FF )   l	 26-00
;     27-3B	   :	 27-3A	       ;     --		   ;	 -- [27-00]
'     28-27        "     28-22         '     --            '     -- [28-00]
`     29-60	   ~	 29-7E	       `     --		   `	 -- [29-00]
Sft   **	   Sft	 **	       Sft   **		   Sft	 **
\     2B-5C	   |	 2B-7C	       \     2B-1C (FS )   \	 2B-00
z     2C-7A	   Z	 2C-5A	       z     2C-1A (SUB)   z	 2C-00
x     2D-78	   X	 2D-58	       x     2D-18 (CAN)   x	 2D-00
c     2E-63	   C	 2E-43	       c     2E-03 (ETX)   c	 2E-00
v     2F-76	   V	 2F-56	       v     2F-16 (SYN)   v	 2F-00
b     30-62	   B	 30-42	       b     30-02 (STX)   b	 30-00
n     31-6E	   N	 31-4E	       n     31-0E (SO )   n	 31-00
m     32-6D	   M	 32-4D	       m     32-0D (CR )   m	 32-00
,     33-2C	   <	 33-3C	       ,     --		   ,	 -- [33-00]
.     34-2E	   >	 34-3E	       .     --		   .	 -- [34-00]
/     35-2F	   ?	 35-3F	       /     --		   /	 -- [35-00]

*     37-2A	   *	 37-2A	       *     --	[96-00]	   *	 -- [37-00]
Alt   **	   Alt	 **	       Alt   **		   Alt	 **
Sp    39-20	   Sp	 39-20	       Sp    39-20	   Sp	 39-00
Cap   **	   Cap	 **	       Cap   **		   Cap	 **
F1    3B-00	   F1	 54-00	       F1    5E-00	   F1	 68-00
F2    3C-00	   F2	 55-00	       F2    5F-00	   F2	 69-00
F3    3D-00	   F3	 56-00	       F3    60-00	   F3	 6A-00
F4    3E-00	   F4	 57-00	       F4    61-00	   F4	 6B-00
F5    3F-00	   F5	 58-00	       F5    62-00	   F5	 6C-00
F6    40-00	   F6	 59-00	       F6    63-00	   F6	 6D-00
F7    41-00	   F7	 5A-00	       F7    64-00	   F7	 6E-00
F8    42-00	   F8	 5B-00	       F8    65-00	   F8	 6F-00
F9    43-00	   F9	 5C-00	       F9    66-00	   F9	 70-00
F10   44-00	   F10	 5D-00	       F10   67-00	   F10	 71-00
F11   85-00	   F11	 87-00	       F11   --	[89-00]	   F11	 -- [8B-00]
F12   86-00	   F12	 88-00	       F12   --	[8A-00]	   F12	 -- [8C-00]
Num   **	   Num	 **	       Num   **		   Num	 **
Scr   **	   Scr	 **	       Brk   00-00	   Scr	 **
Hom   47-00	   Hom	 47-37	       Hom   77-00	   Hom	  ###
Up    48-00	   Up	 48-38	       Up    --	[8D-E0]	   Up	  ###
PgU   49-00	   PgU	 49-39	       PgU   84-00 [E0]	   PgU	  ###
-     4A-2D	   -	 4A-2D	       -     --	[8E-00]	   -	 -- [4A-00]
Lft   4B-00	   Lft	 4B-34	       Lft   73-00	   Lft	  ###
Cen   -- [4C-00]   Cen	 4C-35	       Cen   --	[8F-00]	   Cen	  ###
Rgt   4D-00	   Rgt	 4D-36	       Rgt   74-00	   Rgt	  ###
+     4E-2B	   +	 4E-2B	       +     --	[90-00]	   +	 -- [4E-00]
End   4F-00	   End	 4F-31	       End   75-00	   End	  ###
Dwn   50-00	   Dwn	 50-32	       Dwn   --	[91-00]	   Dwn	  ###
PgD   51-00	   PgD	 51-33	       PgD   76-00	   PgD	  ###
Ins   52-00	   Ins	 52-30	       Ins   --	[92-00]	   Ins	  ###
Del   53-00	   Del	 53-2E	       Del   --	[93-00]	   Del	 --
SyR   **	   SyR	 **	       SyR   **		   SyR	 **
K45   56-5C	   K45	 56-7C	       K45   --		   K45	 --
Ent   -- [E0-0D]   Ent	 -- [E0-0D]    Ent   --	[E0-0A]	   Ent	 -- [A6-00]
/     -- [E0-2F]   /	 -- [E0-2F]    /     --	[95-00]	   /	 -- [A4-00]
PSc   **	   PSc	 **	       PSc   72-00	   PSc	 **
Pse   **	   Pse	 **	       Pse   **		   Pse	 **
Hom   47-00	   Hom	 47-00 [E0]    Hom   77-00 [E0]	   Hom	 -- [97-00]
Up    48-00	   Up	 48-00 [E0]    Up    --	[8D-E0]	   Up	 -- [98-00]
PgU   49-00	   PgU	 49-00 [E0]    PgU   84-00 [E0]	   PgU	 -- [99-00]
Lft   4B-00	   Lft	 4B-00 [E0]    Lft   73-00 [E0]	   Lft	 -- [9B-00]
Rgt   4D-00	   Rgt	 4D-00 [E0]    Rgt   74-00 [E0]	   Rgt	 -- [9D-00]
End   4F-00	   End	 4F-00 [E0]    End   75-00 [E0]	   End	 -- [9F-00]
Dwn   50-00	   Dwn	 50-00 [E0]    Dwn   --	[91-E0]	   Dwn	 -- [A0-00]
PgD   51-00	   PgD	 51-00 [E0]    PgD   76-00 [E0]	   PgD	 -- [A1-00]
Ins   52-00	   Ins	 52-00 [E0]    Ins   --	[92-E0]	   Ins	 -- [A2-00]
Del   53-00	   Del	 53-00 [E0]    Del   --	[93-E0]	   Del	 -- [A3-00]

Double starred entries perform an action, but do not provide a keystroke
in Int 16h.

Double dashed entries are ignored.

The bracketed numbers apply to the 101/102 Extended-Function keyboard,
but not	the 101/102 or the 83/84 standard keyboards.

All keys are 'make/break', except the Pause key.  The make scan	code of
a key is sent to the keyboard controller when the key is pressed, the
break when it is released.  In addition, all keys except the pause
 are 'typematic', sending repeats if held down at a setable rate.
PS/2 keyboards can accepts commands from the system (0EDH to 0FFH)
which selects keyboard scan translation, typematic rate/delay,
combinations of	typematic/make/break for any key, requests its ID, or
resets the keyboard.  For details, see information under Ports 60H-64H.

The pause key causes the keyboard interrupt routine to loop, waiting
for any	other key to be	pressed.  This suspends	further	processing of
the current program, such as a listing or printing.  The key stroke
used to	resume operation is discarded.

When a system request (Alt-PrtSc) key is pressed, 8500H	is placed in
AX by the keyboard interrupt routine, and an Int 15h is	executed.
Release	of system request produces a 8501H in AX.  This	provides a
way to interrupt a program from	the keyboard.  All registers must
be saved except	AX by the Int 15h AH=85h service routine.

The keyboard routine suppresses	the typematic action of	the shift keys
and Num	Lock, Caps Lock, Scroll	Lock, and Ins.

During each Int	9 from the keyboard, an	Int 15h, AH=4Fh	is produced
after the scan code is read from the keyboard controller.  The
scan code is passed in AL with the carry flag set.  This allows
programs to intercept each scan	code prior to its being	handled
by the Int 9h routine.	If the carry flag is cleared on	return
from Int 15h, the scan code will be ignored by the handler.



