1 1.5 hamajima /* $NetBSD: keyboard.h,v 1.5 2003/06/11 07:35:40 hamajima Exp $ */ 2 1.1 tsubai 3 1.1 tsubai /*- 4 1.1 tsubai * Copyright (C) 1993 Allen K. Briggs, Chris P. Caputo, 5 1.1 tsubai * Michael L. Finch, Bradley A. Grantham, and 6 1.1 tsubai * Lawrence A. Kesteloot 7 1.1 tsubai * All rights reserved. 8 1.1 tsubai * 9 1.1 tsubai * Redistribution and use in source and binary forms, with or without 10 1.1 tsubai * modification, are permitted provided that the following conditions 11 1.1 tsubai * are met: 12 1.1 tsubai * 1. Redistributions of source code must retain the above copyright 13 1.1 tsubai * notice, this list of conditions and the following disclaimer. 14 1.1 tsubai * 2. Redistributions in binary form must reproduce the above copyright 15 1.1 tsubai * notice, this list of conditions and the following disclaimer in the 16 1.1 tsubai * documentation and/or other materials provided with the distribution. 17 1.1 tsubai * 3. All advertising materials mentioning features or use of this software 18 1.1 tsubai * must display the following acknowledgement: 19 1.1 tsubai * This product includes software developed by the Alice Group. 20 1.1 tsubai * 4. The names of the Alice Group or any of its members may not be used 21 1.1 tsubai * to endorse or promote products derived from this software without 22 1.1 tsubai * specific prior written permission. 23 1.1 tsubai * 24 1.1 tsubai * THIS SOFTWARE IS PROVIDED BY THE ALICE GROUP ``AS IS'' AND ANY EXPRESS OR 25 1.1 tsubai * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 26 1.1 tsubai * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 27 1.1 tsubai * IN NO EVENT SHALL THE ALICE GROUP BE LIABLE FOR ANY DIRECT, INDIRECT, 28 1.1 tsubai * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 29 1.1 tsubai * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 1.1 tsubai * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 1.1 tsubai * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 1.1 tsubai * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 1.1 tsubai * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 1.1 tsubai */ 35 1.1 tsubai 36 1.1 tsubai #define ADBK_LEFT 0x3B 37 1.1 tsubai #define ADBK_RIGHT 0x3C 38 1.1 tsubai #define ADBK_UP 0x3E 39 1.1 tsubai #define ADBK_DOWN 0x3D 40 1.1 tsubai #define ADBK_PGUP 0x74 41 1.1 tsubai #define ADBK_PGDN 0x79 42 1.1 tsubai #define ADBK_HOME 0x73 43 1.1 tsubai #define ADBK_END 0x77 44 1.1 tsubai #define ADBK_CONTROL 0x36 45 1.1 tsubai #define ADBK_FLOWER 0x37 46 1.1 tsubai #define ADBK_SHIFT 0x38 47 1.1 tsubai #define ADBK_CAPSLOCK 0x39 48 1.1 tsubai #define ADBK_OPTION 0x3A 49 1.1 tsubai #define ADBK_F 0x03 50 1.1 tsubai #define ADBK_O 0x1F 51 1.1 tsubai #define ADBK_P 0x23 52 1.1 tsubai #define ADBK_Q 0x0C 53 1.1 tsubai #define ADBK_V 0x09 54 1.1 tsubai #define ADBK_1 0x12 55 1.1 tsubai #define ADBK_2 0x13 56 1.1 tsubai #define ADBK_3 0x14 57 1.1 tsubai #define ADBK_4 0x15 58 1.1 tsubai #define ADBK_5 0x17 59 1.1 tsubai #define ADBK_6 0x16 60 1.1 tsubai #define ADBK_7 0x1A 61 1.1 tsubai #define ADBK_8 0x1C 62 1.1 tsubai #define ADBK_9 0x19 63 1.1 tsubai #define ADBK_0 0x1D 64 1.1 tsubai 65 1.1 tsubai #define ADBK_KEYVAL(key) ((key) & 0x7f) 66 1.1 tsubai #define ADBK_PRESS(key) (((key) & 0x80) == 0) 67 1.1 tsubai #define ADBK_KEYDOWN(key) (key) 68 1.1 tsubai #define ADBK_KEYUP(key) ((key) | 0x80) 69 1.1 tsubai #define ADBK_MODIFIER(key) ((((key) & 0x7f) == ADBK_SHIFT) || \ 70 1.1 tsubai (((key) & 0x7f) == ADBK_CONTROL) || \ 71 1.1 tsubai (((key) & 0x7f) == ADBK_FLOWER) || \ 72 1.1 tsubai (((key) & 0x7f) == ADBK_OPTION)) 73 1.1 tsubai 74 1.1 tsubai #ifndef KEYBOARD_ARRAY 75 1.4 aymeric extern unsigned char keyboard[128][4]; 76 1.1 tsubai #else 77 1.4 aymeric unsigned char keyboard[128][4] = { 78 1.4 aymeric /* Scan code Normal Shifted Controlled XT */ 79 1.4 aymeric { /* 0x00, */ 'a', 'A', 0x01, 30 }, 80 1.4 aymeric { /* 0x01, */ 's', 'S', 0x13, 31 }, 81 1.4 aymeric { /* 0x02, */ 'd', 'D', 0x04, 32 }, 82 1.4 aymeric { /* 0x03, */ 'f', 'F', 0x06, 33 }, 83 1.4 aymeric { /* 0x04, */ 'h', 'H', 0x08, 35 }, 84 1.4 aymeric { /* 0x05, */ 'g', 'G', 0x07, 34 }, 85 1.4 aymeric { /* 0x06, */ 'z', 'Z', 0x1A, 44 }, 86 1.4 aymeric { /* 0x07, */ 'x', 'X', 0x18, 45 }, 87 1.4 aymeric { /* 0x08, */ 'c', 'C', 0x03, 46 }, 88 1.4 aymeric { /* 0x09, */ 'v', 'V', 0x16, 47 }, 89 1.4 aymeric #ifdef FIX_SV_X_KBDBUG 90 1.4 aymeric { /* 0x0A, */ 0x00, 0x00, 0x00, 41 }, 91 1.4 aymeric #else 92 1.4 aymeric { /* 0x0A, */ 0x00, 0x00, 0x00, 86 }, 93 1.4 aymeric #endif 94 1.4 aymeric { /* 0x0B, */ 'b', 'B', 0x02, 48 }, 95 1.4 aymeric { /* 0x0C, */ 'q', 'Q', 0x11, 16 }, 96 1.4 aymeric { /* 0x0D, */ 'w', 'W', 0x17, 17 }, 97 1.4 aymeric { /* 0x0E, */ 'e', 'E', 0x05, 18 }, 98 1.4 aymeric { /* 0x0F, */ 'r', 'R', 0x12, 19 }, 99 1.4 aymeric { /* 0x10, */ 'y', 'Y', 0x19, 21 }, 100 1.4 aymeric { /* 0x11, */ 't', 'T', 0x14, 20 }, 101 1.4 aymeric { /* 0x12, */ '1', '!', 0x00, 2 }, 102 1.4 aymeric { /* 0x13, */ '2', '@', 0x00, 3 }, 103 1.4 aymeric { /* 0x14, */ '3', '#', 0x00, 4 }, 104 1.4 aymeric { /* 0x15, */ '4', '$', 0x00, 5 }, 105 1.4 aymeric { /* 0x16, */ '6', '^', 0x1E, 7 }, 106 1.4 aymeric { /* 0x17, */ '5', '%', 0x00, 6 }, 107 1.4 aymeric { /* 0x18, */ '=', '+', 0x00, 13 }, 108 1.4 aymeric { /* 0x19, */ '9', '(', 0x00, 10 }, 109 1.4 aymeric { /* 0x1A, */ '7', '&', 0x00, 8 }, 110 1.4 aymeric { /* 0x1B, */ '-', '_', 0x1F, 12 }, 111 1.4 aymeric { /* 0x1C, */ '8', '*', 0x00, 9 }, 112 1.4 aymeric { /* 0x1D, */ '0', ')', 0x00, 11 }, 113 1.4 aymeric { /* 0x1E, */ ']', '}', 0x1D, 27 }, 114 1.4 aymeric { /* 0x1F, */ 'o', 'O', 0x0F, 24 }, 115 1.4 aymeric { /* 0x20, */ 'u', 'U', 0x15, 22 }, 116 1.4 aymeric { /* 0x21, */ '[', '{', 0x1B, 26 }, 117 1.4 aymeric { /* 0x22, */ 'i', 'I', 0x09, 23 }, 118 1.4 aymeric { /* 0x23, */ 'p', 'P', 0x10, 25 }, 119 1.4 aymeric { /* 0x24, */ 0x0D, 0x0D, 0x0D, 28 }, 120 1.4 aymeric { /* 0x25, */ 'l', 'L', 0x0C, 38 }, 121 1.4 aymeric { /* 0x26, */ 'j', 'J', 0x0A, 36 }, 122 1.4 aymeric { /* 0x27, */ '\'', '"', 0x00, 40 }, 123 1.4 aymeric { /* 0x28, */ 'k', 'K', 0x0B, 37 }, 124 1.4 aymeric { /* 0x29, */ ';', ':', 0x00, 39 }, 125 1.4 aymeric { /* 0x2A, */ '\\', '|', 0x1C, 43 }, 126 1.4 aymeric { /* 0x2B, */ ',', '<', 0x00, 51 }, 127 1.4 aymeric { /* 0x2C, */ '/', '?', 0x00, 53 }, 128 1.4 aymeric { /* 0x2D, */ 'n', 'N', 0x0E, 49 }, 129 1.4 aymeric { /* 0x2E, */ 'm', 'M', 0x0D, 50 }, 130 1.4 aymeric { /* 0x2F, */ '.', '>', 0x00, 52 }, 131 1.4 aymeric { /* 0x30, */ 0x09, 0x09, 0x09, 15 }, 132 1.4 aymeric { /* 0x31, */ ' ', ' ', 0x00, 57 }, 133 1.4 aymeric #ifdef FIX_SV_X_KBDBUG 134 1.4 aymeric { /* 0x32, */ '`', '~', 0x00, 86 }, 135 1.4 aymeric #else 136 1.4 aymeric { /* 0x32, */ '`', '~', 0x00, 41 }, 137 1.4 aymeric #endif 138 1.4 aymeric { /* 0x33, */ 0x7F, 0x7F, 0x7F, 211 }, /* Delete */ 139 1.4 aymeric { /* 0x34, */ 0x00, 0x00, 0x00, 105 }, /* MODE/KP_Enter */ 140 1.4 aymeric { /* 0x35, */ 0x1B, 0x1B, 0x1B, 1 }, 141 1.4 aymeric { /* 0x36, */ 0x00, 0x00, 0x00, 29 }, 142 1.4 aymeric { /* 0x37, */ 0x00, 0x00, 0x00, 219 }, 143 1.4 aymeric { /* 0x38, */ 0x00, 0x00, 0x00, 42 }, 144 1.4 aymeric { /* 0x39, */ 0x00, 0x00, 0x00, 58 }, 145 1.4 aymeric { /* 0x3A, */ 0x00, 0x00, 0x00, 56 }, /* L Alt */ 146 1.4 aymeric { /* 0x3B, */ 'h', 0x00, 0x00, 203 }, /* Left */ 147 1.4 aymeric { /* 0x3C, */ 'l', 0x00, 0x00, 205 }, /* Right */ 148 1.4 aymeric { /* 0x3D, */ 'j', 0x00, 0x00, 208 }, /* Down */ 149 1.4 aymeric { /* 0x3E, */ 'k', 0x00, 0x00, 200 }, /* Up */ 150 1.4 aymeric { /* 0x3F, */ 0x00, 0x00, 0x00, 0 }, /* Fn */ 151 1.4 aymeric { /* 0x40, */ 0x00, 0x00, 0x00, 0 }, 152 1.4 aymeric { /* 0x41, */ '.', '.', 0x00, 83 }, 153 1.4 aymeric { /* 0x42, */ 0x00, 0x00, 0x00, 0 }, 154 1.4 aymeric { /* 0x43, */ '*', '*', 0x00, 55 }, 155 1.4 aymeric { /* 0x44, */ 0x00, 0x00, 0x00, 0 }, 156 1.4 aymeric { /* 0x45, */ '+', '+', 0x00, 78 }, 157 1.4 aymeric { /* 0x46, */ 0x00, 0x00, 0x00, 0 }, 158 1.4 aymeric { /* 0x47, */ 0x00, 0x00, 0x00, 69 }, 159 1.4 aymeric { /* 0x48, */ 0x00, 0x00, 0x00, 0 }, 160 1.4 aymeric { /* 0x49, */ 0x00, 0x00, 0x00, 0 }, 161 1.4 aymeric { /* 0x4A, */ 0x00, 0x00, 0x00, 0 }, 162 1.4 aymeric { /* 0x4B, */ '/', '/', 0x00, 181 }, 163 1.4 aymeric { /* 0x4C, */ 0x0D, 0x0D, 0x0D, 156 }, 164 1.4 aymeric { /* 0x4D, */ 0x00, 0x00, 0x00, 0 }, 165 1.4 aymeric { /* 0x4E, */ '-', '-', 0x00, 74 }, 166 1.4 aymeric { /* 0x4F, */ 0x00, 0x00, 0x00, 0 }, 167 1.4 aymeric { /* 0x50, */ 0x00, 0x00, 0x00, 0 }, 168 1.4 aymeric { /* 0x51, */ '=', '=', 0x00, 118 }, 169 1.4 aymeric { /* 0x52, */ '0', '0', 0x00, 82 }, 170 1.4 aymeric { /* 0x53, */ '1', '1', 0x00, 79 }, 171 1.4 aymeric { /* 0x54, */ '2', '2', 0x00, 80 }, 172 1.4 aymeric { /* 0x55, */ '3', '3', 0x00, 81 }, 173 1.4 aymeric { /* 0x56, */ '4', '4', 0x00, 75 }, 174 1.4 aymeric { /* 0x57, */ '5', '5', 0x00, 76 }, 175 1.4 aymeric { /* 0x58, */ '6', '6', 0x00, 77 }, 176 1.4 aymeric { /* 0x59, */ '7', '7', 0x00, 71 }, 177 1.4 aymeric { /* 0x5A, */ 0x00, 0x00, 0x00, 0 }, 178 1.4 aymeric { /* 0x5B, */ '8', '8', 0x00, 72 }, 179 1.4 aymeric { /* 0x5C, */ '9', '9', 0x00, 73 }, 180 1.5 hamajima { /* 0x5D, */ 0x00, 0x00, 0x00, 125 }, 181 1.5 hamajima { /* 0x5E, */ 0x00, 0x00, 0x00, 115 }, 182 1.4 aymeric { /* 0x5F, */ 0x00, 0x00, 0x00, 51 }, 183 1.4 aymeric { /* 0x60, */ 0x00, 0x00, 0x00, 63 }, /* F5 */ 184 1.4 aymeric { /* 0x61, */ 0x00, 0x00, 0x00, 64 }, /* F6 */ 185 1.4 aymeric { /* 0x62, */ 0x00, 0x00, 0x00, 65 }, /* F7 */ 186 1.4 aymeric { /* 0x63, */ 0x00, 0x00, 0x00, 61 }, /* F3 */ 187 1.4 aymeric { /* 0x64, */ 0x00, 0x00, 0x00, 66 }, /* F8 */ 188 1.4 aymeric { /* 0x65, */ 0x00, 0x00, 0x00, 67 }, /* F9 */ 189 1.5 hamajima { /* 0x66, */ 0x00, 0x00, 0x00, 123 }, 190 1.4 aymeric { /* 0x67, */ 0x00, 0x00, 0x00, 87 }, /* F11 */ 191 1.5 hamajima { /* 0x68, */ 0x00, 0x00, 0x00, 112 }, 192 1.4 aymeric { /* 0x69, */ 0x00, 0x00, 0x00, 0 }, 193 1.4 aymeric { /* 0x6A, */ 0x00, 0x00, 0x00, 156 }, 194 1.4 aymeric { /* 0x6B, */ 0x00, 0x00, 0x00, 0 }, 195 1.4 aymeric { /* 0x6C, */ 0x00, 0x00, 0x00, 0 }, 196 1.4 aymeric { /* 0x6D, */ 0x00, 0x00, 0x00, 68 }, /* F10 */ 197 1.4 aymeric { /* 0x6E, */ 0x00, 0x00, 0x00, 0 }, 198 1.4 aymeric { /* 0x6F, */ 0x00, 0x00, 0x00, 88 }, /* F12 */ 199 1.4 aymeric { /* 0x70, */ 0x00, 0x00, 0x00, 0 }, 200 1.4 aymeric { /* 0x71, */ 0x00, 0x00, 0x00, 0 }, 201 1.4 aymeric { /* 0x72, */ 0x00, 0x00, 0x00, 0 }, 202 1.4 aymeric { /* 0x73, */ 0x00, 0x00, 0x00, 199 }, 203 1.4 aymeric { /* 0x74, */ 0x00, 0x00, 0x00, 201 }, 204 1.4 aymeric { /* 0x75, */ 0x00, 0x00, 0x00, 0 }, 205 1.4 aymeric { /* 0x76, */ 0x00, 0x00, 0x00, 62 }, /* F4 */ 206 1.4 aymeric { /* 0x77, */ 0x00, 0x00, 0x00, 207 }, 207 1.4 aymeric { /* 0x78, */ 0x00, 0x00, 0x00, 60 }, /* F2 */ 208 1.4 aymeric { /* 0x79, */ 0x00, 0x00, 0x00, 209 }, 209 1.4 aymeric { /* 0x7A, */ 0x00, 0x00, 0x00, 59 }, /* F1 */ 210 1.4 aymeric { /* 0x7B, */ 0x00, 0x00, 0x00, 0 }, 211 1.4 aymeric { /* 0x7C, */ 0x00, 0x00, 0x00, 0 }, 212 1.4 aymeric { /* 0x7D, */ 0x00, 0x00, 0x00, 0 }, 213 1.4 aymeric { /* 0x7E, */ 0x00, 0x00, 0x00, 0 }, 214 1.4 aymeric { /* 0x7F, */ 0x00, 0x00, 0x00, 0 } /* pwr */ 215 1.1 tsubai }; 216 1.1 tsubai #endif /* KEYBOARD_ARRAY */ 217