1 1.6 tsutsui /* $NetBSD: mkbdmap.h,v 1.6 2002/07/05 14:29:06 tsutsui Exp $ */ 2 1.1 marcus 3 1.3 marcus /*- 4 1.1 marcus * Copyright (c) 2001 Marcus Comstedt 5 1.1 marcus * All rights reserved. 6 1.1 marcus * 7 1.1 marcus * Redistribution and use in source and binary forms, with or without 8 1.1 marcus * modification, are permitted provided that the following conditions 9 1.1 marcus * are met: 10 1.1 marcus * 1. Redistributions of source code must retain the above copyright 11 1.1 marcus * notice, this list of conditions and the following disclaimer. 12 1.1 marcus * 2. Redistributions in binary form must reproduce the above copyright 13 1.1 marcus * notice, this list of conditions and the following disclaimer in the 14 1.1 marcus * documentation and/or other materials provided with the distribution. 15 1.1 marcus * 3. All advertising materials mentioning features or use of this software 16 1.1 marcus * must display the following acknowledgement: 17 1.3 marcus * This product includes software developed by Marcus Comstedt. 18 1.1 marcus * 4. Neither the name of The NetBSD Foundation nor the names of its 19 1.1 marcus * contributors may be used to endorse or promote products derived 20 1.1 marcus * from this software without specific prior written permission. 21 1.1 marcus * 22 1.1 marcus * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 23 1.1 marcus * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 24 1.1 marcus * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 25 1.1 marcus * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 26 1.1 marcus * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 1.1 marcus * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 1.1 marcus * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29 1.1 marcus * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 30 1.1 marcus * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 31 1.1 marcus * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 1.1 marcus * POSSIBILITY OF SUCH DAMAGE. 33 1.1 marcus */ 34 1.1 marcus 35 1.1 marcus #define KC(n) KS_KEYCODE(n) 36 1.1 marcus 37 1.1 marcus static const keysym_t mkbd_keydesc_jp[] = { 38 1.6 tsutsui /* pos command normal shifted */ 39 1.6 tsutsui KC(4), KS_a, 40 1.6 tsutsui KC(5), KS_b, 41 1.6 tsutsui KC(6), KS_c, 42 1.6 tsutsui KC(7), KS_d, 43 1.6 tsutsui KC(8), KS_e, 44 1.6 tsutsui KC(9), KS_f, 45 1.6 tsutsui KC(10), KS_g, 46 1.6 tsutsui KC(11), KS_h, 47 1.6 tsutsui KC(12), KS_i, 48 1.6 tsutsui KC(13), KS_j, 49 1.6 tsutsui KC(14), KS_k, 50 1.6 tsutsui KC(15), KS_l, 51 1.6 tsutsui KC(16), KS_m, 52 1.6 tsutsui KC(17), KS_n, 53 1.6 tsutsui KC(18), KS_o, 54 1.6 tsutsui KC(19), KS_p, 55 1.6 tsutsui KC(20), KS_q, 56 1.6 tsutsui KC(21), KS_r, 57 1.6 tsutsui KC(22), KS_s, 58 1.6 tsutsui KC(23), KS_t, 59 1.6 tsutsui KC(24), KS_u, 60 1.6 tsutsui KC(25), KS_v, 61 1.6 tsutsui KC(26), KS_w, 62 1.6 tsutsui KC(27), KS_x, 63 1.6 tsutsui KC(28), KS_y, 64 1.6 tsutsui KC(29), KS_z, 65 1.6 tsutsui 66 1.6 tsutsui KC(30), KS_1, KS_exclam, 67 1.6 tsutsui KC(31), KS_2, KS_quotedbl, 68 1.6 tsutsui KC(32), KS_3, KS_numbersign, 69 1.6 tsutsui KC(33), KS_4, KS_dollar, 70 1.6 tsutsui KC(34), KS_5, KS_percent, 71 1.6 tsutsui KC(35), KS_6, KS_ampersand, 72 1.6 tsutsui KC(36), KS_7, KS_apostrophe, 73 1.6 tsutsui KC(37), KS_8, KS_parenleft, 74 1.6 tsutsui KC(38), KS_9, KS_parenright, 75 1.6 tsutsui KC(39), KS_0, KS_asciitilde, 76 1.6 tsutsui 77 1.6 tsutsui KC(40), KS_Return, 78 1.6 tsutsui KC(41), KS_Cmd_Debugger, KS_Escape, 79 1.6 tsutsui KC(42), KS_BackSpace, 80 1.6 tsutsui KC(43), KS_Tab, 81 1.6 tsutsui KC(44), KS_space, 82 1.6 tsutsui 83 1.6 tsutsui KC(45), KS_minus, KS_equal, 84 1.6 tsutsui KC(46), KS_asciicircum, KS_macron, 85 1.6 tsutsui KC(47), KS_at, KS_grave, 86 1.6 tsutsui KC(48), KS_bracketleft, KS_braceleft, 87 1.1 marcus /* no 49 */ 88 1.6 tsutsui KC(50), KS_bracketright,KS_braceright, 89 1.6 tsutsui KC(51), KS_semicolon, KS_plus, 90 1.6 tsutsui KC(52), KS_colon, KS_asterisk, 91 1.6 tsutsui KC(53), KS_Zenkaku_Hankaku, 92 1.6 tsutsui KC(54), KS_comma, KS_less, 93 1.6 tsutsui KC(55), KS_period, KS_greater, 94 1.6 tsutsui KC(56), KS_slash, KS_question, 95 1.1 marcus 96 1.6 tsutsui KC(57), KS_Caps_Lock, 97 1.1 marcus 98 1.5 marcus KC(58), KS_Cmd_Screen0, KS_f1, 99 1.5 marcus KC(59), KS_Cmd_Screen1, KS_f2, 100 1.5 marcus KC(60), KS_Cmd_Screen2, KS_f3, 101 1.5 marcus KC(61), KS_Cmd_Screen3, KS_f4, 102 1.5 marcus KC(62), KS_Cmd_Screen4, KS_f5, 103 1.5 marcus KC(63), KS_Cmd_Screen5, KS_f6, 104 1.5 marcus KC(64), KS_Cmd_Screen6, KS_f7, 105 1.5 marcus KC(65), KS_Cmd_Screen7, KS_f8, 106 1.5 marcus KC(66), KS_Cmd_Screen8, KS_f9, 107 1.5 marcus KC(67), KS_Cmd_Screen9, KS_f10, 108 1.6 tsutsui KC(68), KS_f11, 109 1.6 tsutsui KC(69), KS_f12, 110 1.1 marcus 111 1.6 tsutsui KC(70), KS_Print_Screen, 112 1.6 tsutsui KC(71), KS_Hold_Screen, 113 1.6 tsutsui KC(72), KS_Pause, 114 1.6 tsutsui KC(73), KS_Insert, 115 1.6 tsutsui KC(74), KS_Home, 116 1.6 tsutsui KC(75), KS_Prior, 117 1.6 tsutsui KC(76), KS_Delete, 118 1.6 tsutsui KC(77), KS_End, 119 1.6 tsutsui KC(78), KS_Next, 120 1.6 tsutsui KC(79), KS_Right, 121 1.6 tsutsui KC(80), KS_Left, 122 1.6 tsutsui KC(81), KS_Down, 123 1.6 tsutsui KC(82), KS_Up, 124 1.1 marcus 125 1.1 marcus /* 83-99 is numeric keypad */ 126 1.1 marcus 127 1.1 marcus /* 100 is european keyboard only */ 128 1.1 marcus 129 1.6 tsutsui KC(101), KS_Help, 130 1.1 marcus 131 1.1 marcus /* no 102-134 */ 132 1.1 marcus 133 1.6 tsutsui KC(135), KS_backslash, KS_underscore, 134 1.6 tsutsui KC(136), KS_Hiragana_Katakana, 135 1.6 tsutsui KC(137), KS_yen, KS_bar, 136 1.6 tsutsui KC(138), KS_Henkan_Mode, 137 1.6 tsutsui KC(139), KS_Muhenkan, 138 1.6 tsutsui 139 1.6 tsutsui KC(224), KS_Cmd1, KS_Control_L, 140 1.6 tsutsui KC(225), KS_Shift_L, 141 1.6 tsutsui KC(226), KS_Cmd2, KS_Alt_L, 142 1.6 tsutsui KC(227), KS_Meta_L, 143 1.6 tsutsui KC(228), KS_Control_R, 144 1.6 tsutsui KC(229), KS_Shift_R, 145 1.6 tsutsui KC(230), KS_Alt_R, KS_Multi_key, 146 1.6 tsutsui KC(231), KS_Meta_R, 147 1.1 marcus }; 148 1.1 marcus 149 1.2 marcus 150 1.2 marcus static const keysym_t mkbd_keydesc_uk[] = { 151 1.6 tsutsui /* pos command normal shifted */ 152 1.2 marcus 153 1.6 tsutsui KC(32), KS_3, KS_sterling, 154 1.2 marcus 155 1.6 tsutsui KC(35), KS_6, KS_asciicircum, 156 1.6 tsutsui KC(36), KS_7, KS_ampersand, 157 1.6 tsutsui KC(37), KS_8, KS_asterisk, 158 1.6 tsutsui KC(38), KS_9, KS_parenleft, 159 1.6 tsutsui KC(39), KS_0, KS_parenright, 160 1.6 tsutsui 161 1.6 tsutsui KC(45), KS_minus, KS_underscore, 162 1.6 tsutsui KC(46), KS_equal, KS_plus, 163 1.6 tsutsui KC(47), KS_bracketleft, KS_braceleft, 164 1.6 tsutsui KC(48), KS_bracketright,KS_braceright, 165 1.6 tsutsui 166 1.6 tsutsui KC(50), KS_numbersign, KS_asciitilde, 167 1.6 tsutsui KC(51), KS_semicolon, KS_colon, 168 1.6 tsutsui KC(52), KS_apostrophe, KS_at, 169 1.6 tsutsui KC(53), KS_grave, KS_notsign, KS_brokenbar, 170 1.6 tsutsui 171 1.6 tsutsui KC(83), KS_Num_Lock, 172 1.6 tsutsui KC(84), KS_KP_Divide, 173 1.6 tsutsui KC(85), KS_KP_Multiply, 174 1.6 tsutsui KC(86), KS_KP_Subtract, 175 1.6 tsutsui KC(87), KS_KP_Add, 176 1.6 tsutsui KC(88), KS_KP_Enter, 177 1.6 tsutsui KC(89), KS_KP_1, 178 1.6 tsutsui KC(90), KS_KP_2, 179 1.6 tsutsui KC(91), KS_KP_3, 180 1.6 tsutsui KC(92), KS_KP_4, 181 1.6 tsutsui KC(93), KS_KP_5, 182 1.6 tsutsui KC(94), KS_KP_6, 183 1.6 tsutsui KC(95), KS_KP_7, 184 1.6 tsutsui KC(96), KS_KP_8, 185 1.6 tsutsui KC(97), KS_KP_9, 186 1.6 tsutsui KC(98), KS_KP_0, 187 1.6 tsutsui KC(99), KS_KP_Decimal, 188 1.2 marcus 189 1.6 tsutsui KC(100), KS_backslash, KS_bar, 190 1.2 marcus }; 191 1.2 marcus 192 1.4 thorpej static const keysym_t mkbd_keydesc_us[] = { 193 1.6 tsutsui /* pos command normal shifted */ 194 1.4 thorpej 195 1.6 tsutsui KC(31), KS_2, KS_at, 196 1.4 thorpej 197 1.6 tsutsui KC(35), KS_6, KS_asciicircum, 198 1.6 tsutsui KC(36), KS_7, KS_ampersand, 199 1.6 tsutsui KC(37), KS_8, KS_asterisk, 200 1.6 tsutsui KC(38), KS_9, KS_parenleft, 201 1.6 tsutsui KC(39), KS_0, KS_parenright, 202 1.6 tsutsui 203 1.6 tsutsui KC(45), KS_minus, KS_underscore, 204 1.6 tsutsui KC(46), KS_equal, KS_plus, 205 1.6 tsutsui KC(47), KS_bracketleft, KS_braceleft, 206 1.6 tsutsui KC(48), KS_bracketright,KS_braceright, 207 1.6 tsutsui KC(49), KS_backslash, KS_bar, 208 1.6 tsutsui 209 1.6 tsutsui KC(51), KS_semicolon, KS_colon, 210 1.6 tsutsui KC(52), KS_apostrophe, KS_quotedbl, 211 1.6 tsutsui KC(53), KS_grave, KS_asciitilde, 212 1.6 tsutsui 213 1.6 tsutsui KC(83), KS_Num_Lock, 214 1.6 tsutsui KC(84), KS_KP_Divide, 215 1.6 tsutsui KC(85), KS_KP_Multiply, 216 1.6 tsutsui KC(86), KS_KP_Subtract, 217 1.6 tsutsui KC(87), KS_KP_Add, 218 1.6 tsutsui KC(88), KS_KP_Enter, 219 1.6 tsutsui KC(89), KS_KP_1, 220 1.6 tsutsui KC(90), KS_KP_2, 221 1.6 tsutsui KC(91), KS_KP_3, 222 1.6 tsutsui KC(92), KS_KP_4, 223 1.6 tsutsui KC(93), KS_KP_5, 224 1.6 tsutsui KC(94), KS_KP_6, 225 1.6 tsutsui KC(95), KS_KP_7, 226 1.6 tsutsui KC(96), KS_KP_8, 227 1.6 tsutsui KC(97), KS_KP_9, 228 1.6 tsutsui KC(98), KS_KP_0, 229 1.6 tsutsui KC(99), KS_KP_Decimal, 230 1.6 tsutsui }; 231 1.6 tsutsui 232 1.6 tsutsui static const keysym_t mkbd_keydesc_swapctrlcaps[] = { 233 1.6 tsutsui /* pos command normal shifted */ 234 1.6 tsutsui KC(57), KS_Cmd1, KS_Control_L, 235 1.6 tsutsui KC(224), KS_Caps_Lock, 236 1.4 thorpej }; 237 1.4 thorpej 238 1.1 marcus #define KBD_MAP(name, base, map) \ 239 1.1 marcus { name, base, sizeof(map)/sizeof(keysym_t), map } 240 1.1 marcus 241 1.1 marcus static const struct wscons_keydesc mkbd_keydesctab[] = { 242 1.1 marcus KBD_MAP(KB_JP, 0, mkbd_keydesc_jp), 243 1.2 marcus KBD_MAP(KB_UK, KB_JP, mkbd_keydesc_uk), 244 1.4 thorpej KBD_MAP(KB_US, KB_JP, mkbd_keydesc_us), 245 1.6 tsutsui KBD_MAP(KB_JP | KB_SWAPCTRLCAPS, KB_JP, mkbd_keydesc_swapctrlcaps), 246 1.6 tsutsui KBD_MAP(KB_UK | KB_SWAPCTRLCAPS, KB_UK, mkbd_keydesc_swapctrlcaps), 247 1.6 tsutsui KBD_MAP(KB_US | KB_SWAPCTRLCAPS, KB_US, mkbd_keydesc_swapctrlcaps), 248 1.1 marcus {0, 0, 0, 0} 249 1.1 marcus }; 250 1.1 marcus 251 1.1 marcus #undef KBD_MAP 252 1.1 marcus #undef KC 253