1/* $NetBSD: akbdmap.h,v 1.9 2006/11/08 03:27:29 macallan Exp $ */ 2 3/*- 4 * Copyright (c) 1997 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Juergen Hannken-Illjes. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32/* XXX This list is incomplete. */ 33 34#define KC(n) KS_KEYCODE(n) 35 36static const keysym_t akbd_keydesc_us[] = { 37/* pos command normal shifted */ 38 KC(0), KS_a, 39 KC(1), KS_s, 40 KC(2), KS_d, 41 KC(3), KS_f, 42 KC(4), KS_h, 43 KC(5), KS_g, 44 KC(6), KS_z, 45 KC(7), KS_x, 46 KC(8), KS_c, 47 KC(9), KS_v, 48 KC(10), KS_paragraph, 49 KC(11), KS_b, 50 KC(12), KS_q, 51 KC(13), KS_w, 52 KC(14), KS_e, 53 KC(15), KS_r, 54 KC(16), KS_y, 55 KC(17), KS_t, 56 KC(18), KS_1, KS_exclam, 57 KC(19), KS_2, KS_at, 58 KC(20), KS_3, KS_numbersign, 59 KC(21), KS_4, KS_dollar, 60 KC(22), KS_6, KS_asciicircum, 61 KC(23), KS_5, KS_percent, 62 KC(24), KS_equal, KS_plus, 63 KC(25), KS_9, KS_parenleft, 64 KC(26), KS_7, KS_ampersand, 65 KC(27), KS_minus, KS_underscore, 66 KC(28), KS_8, KS_asterisk, 67 KC(29), KS_0, KS_parenright, 68 KC(30), KS_bracketright, KS_braceright, 69 KC(31), KS_o, 70 KC(32), KS_u, 71 KC(33), KS_bracketleft, KS_braceleft, 72 KC(34), KS_i, 73 KC(35), KS_p, 74 KC(36), KS_Return, 75 KC(37), KS_l, 76 KC(38), KS_j, 77 KC(39), KS_apostrophe, KS_quotedbl, 78 KC(40), KS_k, 79 KC(41), KS_semicolon, KS_colon, 80 KC(42), KS_backslash, KS_bar, 81 KC(43), KS_comma, KS_less, 82 KC(44), KS_slash, KS_question, 83 KC(45), KS_n, 84 KC(46), KS_m, 85 KC(47), KS_period, KS_greater, 86 KC(48), KS_Tab, 87 KC(49), KS_space, 88 KC(50), KS_grave, KS_asciitilde, 89 KC(51), KS_Delete, 90 KC(52), KS_KP_Enter, /* Pretend this is alt-R ? */ 91 KC(53), KS_Escape, 92 KC(54), KS_Control_L, 93 KC(55), KS_Cmd, /* Command */ 94 KC(56), KS_Shift_L, 95 KC(57), KS_Caps_Lock, 96 KC(58), KS_Cmd1, /* Option */ 97 KC(59), KS_Left, 98 KC(60), KS_Right, 99 KC(61), KS_Down, 100 KC(62), KS_Up, 101 102 KC(65), KS_KP_Decimal, 103 KC(67), KS_KP_Multiply, 104 KC(69), KS_KP_Add, 105 KC(71), KS_Num_Lock, 106 KC(75), KS_KP_Divide, 107 KC(76), KS_KP_Enter, 108 KC(78), KS_KP_Subtract, 109 110 KC(81), KS_KP_Equal, 111 KC(82), KS_KP_Insert, KS_KP_0, 112 KC(83), KS_KP_End, KS_KP_1, 113 KC(84), KS_KP_Down, KS_KP_2, 114 KC(85), KS_KP_Next, KS_KP_3, 115 KC(86), KS_KP_Left, KS_KP_4, 116 KC(87), KS_KP_Begin, KS_KP_5, 117 KC(88), KS_KP_Right, KS_KP_6, 118 KC(89), KS_KP_Home, KS_KP_7, 119 120 KC(91), KS_KP_Up, KS_KP_8, 121 KC(92), KS_KP_Prior, KS_KP_9, 122 123 KC(95), KS_KP_Delete, KS_KP_Decimal, 124 KC(96), KS_Cmd_Screen4, KS_f5, 125 KC(97), KS_Cmd_Screen5, KS_f6, 126 KC(98), KS_Cmd_Screen6, KS_f7, 127 KC(99), KS_Cmd_Screen2, KS_f3, 128 KC(100),KS_Cmd_Screen7, KS_f8, 129 130 KC(101),KS_Cmd_Screen8, KS_f9, 131 132 KC(103), KS_f11, 133 134 KC(105), KS_Print_Screen, 135 KC(106), KS_KP_Enter, 136 KC(107), KS_Hold_Screen, 137 138 KC(109),KS_Cmd_Screen9, KS_f10, 139 140 KC(111), KS_f12, 141 142 KC(113), KS_Pause, 143 KC(114), KS_Insert, 144 KC(115), KS_Home, 145 KC(116), KS_Prior, 146 KC(117), KS_Delete, /* BackSpace */ 147 KC(118),KS_Cmd_Screen3, KS_f4, 148 KC(119), KS_End, 149 KC(120),KS_Cmd_Screen1, KS_f2, 150 KC(121), KS_Next, 151 KC(122),KS_Cmd_Screen0, KS_f1, 152 153 KC(127), KS_Cmd_Debugger, 154}; 155 156static const keysym_t akbd_keydesc_fr[] = { 157/* pos normal shifted altgr shift-altgr */ 158 KC(0), KS_q, 159 KC(1), KS_s, KS_S, KS_Ograve, 160 KC(4), KS_h, KS_H, KS_Igrave, KS_Icircumflex, 161 KC(6), KS_w, KS_W, KS_less, KS_greater, 162 KC(8), KS_c, KS_C, KS_copyright, KS_cent, 163 KC(10), KS_at, KS_numbersign, 164 KC(11), KS_b, KS_B, KS_ssharp, 165 KC(12), KS_a, KS_A, KS_ae, KS_AE, 166 KC(13), KS_z, KS_Z, KS_Acircumflex, KS_Aring, 167 KC(14), KS_e, KS_E, KS_ecircumflex, KS_Ecircumflex, 168 KC(15), KS_r, KS_R, KS_registered, /* Euro */ 169 KC(16), KS_y, KS_Y, KS_Uacute, 170 KC(18), KS_ampersand, KS_1, KS_voidSymbol, KS_dead_acute, 171 KC(19), KS_eacute, KS_2, KS_ediaeresis, 172 KC(20), KS_quotedbl, KS_3, 173 KC(21), KS_apostrophe, KS_4, KS_braceleft, KS_bracketleft, 174 KC(22), KS_section, KS_6, KS_paragraph, 175 KC(23), KS_parenleft, KS_5, KS_braceleft, KS_bracketleft, 176 KC(24), KS_minus, KS_underscore, KS_braceright, 177 KC(25), KS_ccedilla, KS_9, KS_Ccedilla, KS_Agrave, 178 KC(26), KS_egrave, KS_7, KS_guillemotleft,KS_guillemotright, 179 KC(27), KS_parenright, KS_degree, KS_braceright, KS_bracketright, 180 KC(28), KS_exclam, KS_8, KS_exclamdown, KS_Ucircumflex, 181 KC(29), KS_agrave, KS_0, KS_oslash, 182 KC(30), KS_dollar, KS_asterisk, KS_comma, KS_yen, 183 KC(33), KS_dead_circumflex, KS_dead_diaeresis,KS_ocircumflex,KS_Ocircumflex, 184 KC(34), KS_i, KS_I, KS_icircumflex, KS_Icircumflex, 185 KC(37), KS_l, KS_L, KS_notsign, KS_bar, 186 KC(38), KS_j, KS_J, KS_Idiaeresis, KS_Igrave, 187 KC(39), KS_ugrave, KS_percent, KS_Ugrave, 188 KC(40), KS_k, KS_K, KS_Egrave, KS_Ediaeresis, 189 KC(41), KS_m, KS_M, KS_mu, KS_Ograve, 190 KC(42), KS_dead_grave, KS_sterling, KS_at, KS_numbersign, 191 KC(43), KS_semicolon, KS_period, 192 KC(44), KS_equal, KS_plus, KS_voidSymbol, KS_plusminus, 193 KC(45), KS_n, KS_N, KS_dead_tilde, 194 KC(46), KS_comma, KS_question, KS_voidSymbol, KS_questiondown, 195 KC(47), KS_colon, KS_slash, KS_division, KS_backslash, 196 KC(50), KS_less, KS_greater, 197 KC(52), KS_Alt_R, 198 KC(55), KS_Meta_L, /* Command */ 199 KC(58), KS_Mode_switch, KS_Multi_key, /* Option */ 200}; 201 202static const keysym_t akbd_keydesc_fr_nodead[] = { 203 KC(18), KS_ampersand, KS_1, KS_voidSymbol, KS_acute, 204 KC(33), KS_asciicircum, KS_diaeresis, KS_ocircumflex, KS_Ocircumflex, 205 KC(42), KS_grave, KS_sterling, KS_at, KS_numbersign, 206 KC(45), KS_n, KS_N, KS_asciitilde, 207}; 208 209static const keysym_t akbd_keydesc_jp[] = { 210/* pos command normal shifted */ 211 KC(19), KS_2, KS_quotedbl, 212 KC(22), KS_6, KS_ampersand, 213 KC(24), KS_asciicircum, KS_asciitilde, 214 KC(25), KS_9, KS_parenright, 215 KC(26), KS_7, KS_apostrophe, 216 KC(27), KS_minus, KS_equal, 217 KC(28), KS_8, KS_parenleft, 218 KC(29), KS_0, 219 KC(30), KS_bracketleft, KS_braceleft, 220 KC(33), KS_at, KS_grave, 221 KC(39), KS_colon, KS_asterisk, 222 223 KC(41), KS_semicolon, KS_plus, 224 KC(42), KS_bracketright,KS_braceright, 225 KC(93), KS_backslash, KS_bar, 226 KC(94), KS_underscore, 227}; 228 229static const keysym_t akbd_keydesc_uk[] = { 230/* pos normal shifted altgr shift-altgr */ 231 KC(10), KS_section, KS_plusminus, 232 KC(20), KS_3, KS_sterling, KS_numbersign, 233 KC(52), KS_KP_Enter, 234 KC(58), KS_Mode_switch, KS_Multi_key, /* Option */ 235}; 236 237static const keysym_t akbd_keydesc_sv[] = { 238/* pos normal shifted altgr shift-altgr */ 239 KC(10), KS_section, KS_degree, 240 KC(19), KS_2, KS_quotedbl, KS_at, 241 KC(21), KS_4, KS_dollar, 242 KC(22), KS_6, KS_ampersand, 243 KC(24), KS_dead_acute, KS_dead_grave, 244 KC(25), KS_9, KS_parenright, KS_bracketright, 245 KC(26), KS_7, KS_slash, KS_braceleft, 246 KC(27), KS_plus, KS_question, KS_backslash, 247 KC(28), KS_8, KS_parenleft, KS_bracketleft, 248 KC(29), KS_0, KS_equal, KS_braceright, 249 KC(30), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde, 250 KC(33), KS_aring, 251 KC(39), KS_adiaeresis, 252 KC(41), KS_odiaeresis, 253 KC(42), KS_apostrophe, KS_asterisk, 254 KC(43), KS_comma, KS_semicolon, 255 KC(44), KS_minus, KS_underscore, 256 KC(47), KS_period, KS_colon, 257 KC(50), KS_less, KS_greater, KS_bar, 258 KC(58), KS_Mode_switch,KS_Multi_key, 259}; 260 261static const keysym_t akbd_keydesc_sv_nodead[] = { 262/* pos normal shifted altgr shift-altgr */ 263 KC(24), KS_apostrophe, KS_grave, 264 KC(30), KS_diaeresis, KS_asciicircum, KS_asciitilde, 265}; 266 267static const keysym_t akbd_keydesc_de[] = { 268/* pos normal shifted altgr shift-altgr */ 269 KC(0), KS_a, KS_A, KS_aring, KS_Aring, 270 KC(1), KS_s, KS_S, KS_voidSymbol, KS_Iacute, 271 KC(3), KS_f, KS_F, KS_voidSymbol, KS_Idiaeresis, 272 KC(4), KS_h, KS_H, KS_ordfeminine, KS_Oacute, 273 KC(5), KS_g, KS_G, KS_copyright, KS_Igrave, 274 KC(6), KS_y, KS_Y, KS_yen, 275 KC(7), KS_x, KS_X, KS_voidSymbol, KS_Ugrave, 276 KC(8), KS_c, KS_C, KS_ccedilla, KS_Ccedilla, 277 KC(10), KS_dead_circumflex,KS_degree, 278 KC(12), KS_q, KS_Q, KS_guillemotleft,KS_guillemotright, 279 KC(15), KS_r, KS_R, KS_registered, KS_cedilla, 280 KC(16), KS_z, KS_Z, 281 KC(18), KS_1, KS_exclam, KS_exclamdown, KS_notsign, 282 KC(19), KS_2, KS_quotedbl, 283 KC(20), KS_3, KS_section, KS_paragraph, KS_numbersign, 284 KC(21), KS_4, KS_dollar, KS_cent, KS_sterling, 285 KC(22), KS_6, KS_ampersand, KS_bracketright,KS_dead_circumflex, 286 KC(23), KS_5, KS_percent, KS_bracketleft, 287 KC(24), KS_dead_acute, KS_dead_grave, KS_apostrophe, 288 KC(25), KS_9, KS_parenright, KS_braceright, KS_periodcentered, 289 KC(26), KS_7, KS_slash, KS_bar, KS_backslash, 290 KC(27), KS_ssharp, KS_question, KS_questiondown, 291 KC(28), KS_8, KS_parenleft, KS_braceleft, 292 KC(29), KS_0, KS_equal, KS_voidSymbol, KS_macron, 293 KC(30), KS_plus, KS_asterisk, KS_plusminus, 294 KC(31), KS_o, KS_O, KS_oslash, KS_Ooblique, 295 KC(32), KS_u, KS_U, KS_dead_diaeresis,KS_Aacute, 296 KC(33), KS_udiaeresis, KS_Udiaeresis, KS_voidSymbol, KS_degree, 297 KC(34), KS_i, KS_I, KS_voidSymbol, KS_Ucircumflex, 298 KC(37), KS_l, KS_L, KS_at, 299 KC(38), KS_j, KS_J, KS_masculine, 300 KC(39), KS_adiaeresis, KS_Adiaeresis, KS_ae, KS_AE, 301 KC(41), KS_odiaeresis, KS_Odiaeresis, 302 KC(42), KS_numbersign, KS_apostrophe, 303 KC(43), KS_comma, KS_semicolon, 304 KC(44), KS_minus, KS_underscore, 305 KC(45), KS_n, KS_N, KS_dead_tilde, 306 KC(46), KS_m, KS_M, KS_mu, 307 KC(47), KS_period, KS_colon, 308 KC(50), KS_less, KS_greater, 309 KC(52), KS_Multi_key, 310 KC(58), KS_Mode_switch, 311}; 312 313static const keysym_t akbd_keydesc_de_nodead[] = { 314/* pos normal shifted altgr shift-altgr */ 315 KC(10), KS_asciicircum, KS_degree, 316 KC(22), KS_6, KS_ampersand, KS_bracketright,KS_asciicircum, 317 KC(24), KS_acute, KS_grave, KS_apostrophe, 318 KC(32), KS_u, KS_U, KS_diaeresis, KS_Aacute, 319 KC(45), KS_n, KS_N, KS_asciitilde, 320}; 321 322static const keysym_t akbd_keydesc_sf[] = { 323/* pos normal shifted altgr shift-altgr */ 324 KC(6), KS_y, 325 KC(10), KS_paragraph, KS_degree, 326 KC(16), KS_z, 327 KC(18), KS_plus, KS_1, 328 KC(19), KS_quotedbl, KS_2, 329 KC(20), KS_asterisk, KS_3, 330 KC(21), KS_ccedilla, KS_4, KS_Ccedilla, 331 KC(22), KS_ampersand, KS_6, 332 KC(23), KS_percent, KS_5, 333 KC(24), KS_dead_circumflex,KS_grave, 334 KC(25), KS_parenright, KS_9, 335 KC(26), KS_slash, KS_7, 336 KC(27), KS_apostrophe, KS_question, 337 KC(28), KS_parenleft, KS_8, 338 KC(29), KS_equal, KS_0, 339 KC(30), KS_dead_diaeresis,KS_exclam, 340 KC(33), KS_egrave, KS_udiaeresis, 341 KC(39), KS_agrave, KS_adiaeresis, 342 KC(41), KS_eacute, KS_odiaeresis, 343 KC(42), KS_dollar, KS_sterling, 344 KC(43), KS_period, KS_colon, 345 KC(46), KS_comma, KS_semicolon, 346 KC(47), KS_minus, KS_underscore, 347 KC(50), KS_less, KS_greater, 348}; 349 350static const keysym_t akbd_keydesc_es[] = { 351/* pos normal shifted altgr shift-altgr */ 352 KC(10), KS_degree, KS_ordfeminine, KS_backslash, 353 KC(18), KS_1, KS_exclam, KS_bar, 354 KC(19), KS_2, KS_quotedbl, KS_at, 355 KC(20), KS_3, KS_periodcentered, KS_numbersign, 356 KC(21), KS_4, KS_dollar, KS_asciitilde, 357 KC(22), KS_6, KS_ampersand, KS_notsign, 358 KC(23), KS_5, KS_percent, 359 KC(24), KS_exclamdown, KS_questiondown, 360 KC(25), KS_9, KS_parenright, 361 KC(26), KS_7, KS_slash, 362 KC(27), KS_apostrophe, KS_question, 363 KC(28), KS_8, KS_parenleft, 364 KC(29), KS_0, KS_equal, 365 KC(30), KS_plus, KS_asterisk, KS_bracketright, 366 KC(33), KS_dead_grave, KS_dead_circumflex, KS_bracketleft, 367 KC(39), KS_dead_acute, KS_dead_diaeresis, KS_braceleft, 368 KC(41), KS_ntilde, 369 KC(42), KS_ccedilla, KS_Ccedilla, KS_braceright, 370 KC(43), KS_comma, KS_semicolon, 371 KC(44), KS_minus, KS_underscore, 372 KC(47), KS_period, KS_colon, 373 KC(50), KS_less, KS_greater, 374 KC(55), KS_Alt_L, /* Command */ 375 KC(58), KS_Mode_switch, KS_Multi_key, /* Option */ 376}; 377 378static const keysym_t akbd_keydesc_pt[] = { 379/* pos normal shifted altgr shift-altgr */ 380 KC(7), KS_x, KS_X, KS_guillemotleft, KS_guillemotright, 381 KC(10), KS_section, KS_plusminus, 382 KC(19), KS_2, KS_quotedbl, KS_at, 383 KC(20), KS_3, KS_numbersign, KS_sterling, 384 KC(22), KS_6, KS_ampersand, 385 KC(24), KS_plus, KS_asterisk, 386 KC(25), KS_9, KS_parenright, KS_bracketright, KS_braceright, 387 KC(26), KS_7, KS_slash, 388 KC(27), KS_apostrophe, KS_question, 389 KC(28), KS_8, KS_parenleft, KS_bracketleft, KS_braceleft, 390 KC(29), KS_0, KS_equal, 391 KC(30), KS_dead_acute, KS_dead_grave, 392 KC(33), KS_masculine, KS_ordfeminine, 393 KC(39), KS_dead_tilde, KS_dead_circumflex, 394 KC(41), KS_ccedilla, KS_Ccedilla, 395 KC(43), KS_comma, KS_semicolon, 396 KC(44), KS_minus, KS_underscore, 397 KC(47), KS_period, KS_colon, 398 KC(50), KS_less, KS_greater, 399 KC(58), KS_Mode_switch, 400 KC(81), KS_KP_Equal, 401}; 402 403#define KBD_MAP(name, base, map) \ 404 { name, base, sizeof(map)/sizeof(keysym_t), map } 405 406static const struct wscons_keydesc akbd_keydesctab[] = { 407 KBD_MAP(KB_US, 0, akbd_keydesc_us), 408 KBD_MAP(KB_FR, KB_US, akbd_keydesc_fr), 409 KBD_MAP(KB_JP, KB_US, akbd_keydesc_jp), 410 KBD_MAP(KB_FR | KB_NODEAD, KB_FR, akbd_keydesc_fr_nodead), 411 KBD_MAP(KB_SF, KB_US, akbd_keydesc_sf), 412 KBD_MAP(KB_SV, KB_US, akbd_keydesc_sv), 413 KBD_MAP(KB_SV | KB_NODEAD, KB_SV, akbd_keydesc_sv_nodead), 414 KBD_MAP(KB_DE, KB_US, akbd_keydesc_de), 415 KBD_MAP(KB_DE | KB_NODEAD, KB_DE, akbd_keydesc_de_nodead), 416 KBD_MAP(KB_UK, KB_US, akbd_keydesc_uk), 417 KBD_MAP(KB_ES, KB_US, akbd_keydesc_es), 418 KBD_MAP(KB_PT, KB_US, akbd_keydesc_pt), 419 {0, 0, 0, 0} 420}; 421 422#undef KBD_MAP 423#undef KC 424 425