Newsgroups: comp.sys.apple2 Path: news.uiowa.edu!uunet!in1.uu.net!spool.mu.edu!agate!ames!waikato!comp.vuw.ac.nz!actrix.gen.nz!dempson From: dempson@atlantis.actrix.gen.nz (David Empson) Subject: IBM Keycodes (was Re: Proterm help) Message-ID: Sender: news@actrix.gen.nz (News Administrator) Organization: Actrix - Internet Services Date: Sun, 20 Aug 1995 15:04:46 GMT References: <8AF7469.02170001F6.uuout@powerlink.iconz.co.nz> <8AF827E.02170001F9.uuout@powerlink.iconz.co.nz> X-Nntp-Posting-Host: atlantis.actrix.gen.nz Lines: 146 Here is a complete list (I think) of IBM keycodes, which I've derived mainly from experimentation over a couple of years. If you find any errors or omissions, please let me know. IBM Extended Keyboard codes, including extended BIOS by David Empson (dempson@actrix.gen.nz) The keycode returned by BIOS functions $10 and $11 can be any of: High Low $00 $00 Ctrl-Break $00 nn Alt-number typed on numeric keypad nn $00 Extended key (see below for nn values) nn $E0 Extended key on additional block (see below), nn > $00 xx nn Standard keypress. nn <= $7F, xx = scan code. The nn:$E0 group is the additional keys which are only present on an extended keyboard, and duplicate the special functions of the numeric keypad, i.e. Insert, Delete, Home, End, Page Up, Page Down and the arrow keys. The $E0 value is returned in the low byte for these keys if pressed without a modifier, or with Ctrl. The Shift key has no effect on these keys. If Alt is used, the low byte is $00 (e.g. Home=$47E0, Ctrl-Home=$77E0, Alt-Home=$9700). The $E0 in the low byte distinguishes the additional key block from the numeric keypad, which returns a $00 in the low byte. Also note that the numeric keypad "/" and "Enter" keys return codes of $E02F and $E00D, which distinguishes them from the standard keys ($352F and $1C0D). If Ctrl is pressed, either Enter key generates LF ($0A) instead of CR ($0D), with the same high byte as normal ($1C or $E0). Ctrl-Backspace generates $7F (DEL) with the same high byte as normal ($0E). If the keyboard is read through DOS, the returned key values are: $01-$7F Normal ASCII key, or Alt-number typed on numeric keypad $80-$FF Alt-number typed on numeric keypad (128 to 255) $00 Prefix byte for extended keys, followed by scan code byte Extended keys are returned as a scan code, as listed in the table. Extended BIOS calls are only used by some versions of DOS, so the keys marked with * may not be available through DOS. Notes: * code is only returned by extended BIOS calls ($10, $11) - code cannot be generated on the keyboard Code (hex) Notes Key combination 1 01 * Alt ESC 2 02 - 3 03 NUL (Ctrl @) 4-13 04-0D - 14 0E * Alt Backspace 15 0F Shift TAB 16-25 10-19 Alt QWERTYUIOP 26 1A * Alt [ 27 1B * Alt ] 28 1C * Alt Enter 29 1D - (Alt Ctrl) 30-38 1E-26 Alt ASDFGHJKL 39 27 * Alt ; 40 28 * Alt ' 41 29 * Alt ` 42 2A - (Alt Left Shift) 43 2B * Alt \ 44-50 2C-32 Alt ZXCVBNM 51 33 * Alt , 52 34 * Alt . 53 35 * Alt / 54 36 - (Alt Right Shift) 55 37 * Alt KP * 56-58 38-3A - 59-68 3B-44 F1-F10 (Base case) 69-70 45-46 - 71 47 Home 72 48 Up arrow 73 49 PgUp 74 4A * Alt KP - 75 4B Left arrow 76 4C * KP 5 77 4D Right arrow 78 4E * Alt KP + 79 4F End 80 50 Down arrow 81 51 PgDn 82 52 Ins 83 53 Del 84-93 54-5D Shift F1-F10 94-103 5E-67 Ctrl F1-F10 104-113 68-71 Alt F1-F10 114 72 Ctrl PrtScrn 115 73 Ctrl Left arrow 116 74 Ctrl Right arrow 117 75 Ctrl End 118 76 Ctrl PgDn 119 77 Ctrl Home 120-131 78-83 Alt 1-0, -, = 132 84 Ctrl PgUp 133 85 * F11 134 86 * F12 135 87 * Shift F11 136 88 * Shift F12 137 89 * Ctrl F11 138 8A * Ctrl F12 139 8B * Alt F11 140 8C * Alt F12 141 8D * Ctrl Up arrow 142 8E * Ctrl KP - 143 8F * Ctrl KP 5 144 90 * Ctrl KP + 145 91 * Ctrl Down arrow 146 92 * Ctrl Ins 147 93 * Ctrl Del 148 94 * Ctrl TAB 149 95 * Ctrl KP / 150 96 * Ctrl KP * 151 97 * Alt Home 152 98 * Alt Up arrow 153 99 * Alt PgUp 154 9A - 155 9B * Alt Left arrow 156 9C - (Alt KP 5) 157 9D * Alt Right arrow 158 9E - 159 9F * Alt End 160 A0 * Alt Down arrow 161 A1 * Alt PgDn 162 A2 * Alt Ins 163 A3 * Alt Del 164 A4 * Alt KP / 165 A5 * Alt TAB 166 A6 * Alt KP Enter 167-255 A7-FF - -- David Empson dempson@actrix.gen.nz Snail mail: P.O. Box 27-103, Wellington, New Zealand