1 /* $NetBSD: adb_keymap.h,v 1.5 2014/11/08 16:52:35 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 36 static 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_Cmd_ScrollSlowDown, KS_Down, 100 KC(62), KS_Cmd_ScrollSlowUp, KS_Up, 101 KC(65), KS_KP_Decimal, 102 KC(67), KS_KP_Multiply, 103 KC(69), KS_KP_Add, 104 KC(71), KS_Num_Lock, 105 KC(75), KS_KP_Divide, 106 KC(76), KS_KP_Enter, 107 KC(78), KS_KP_Subtract, 108 109 KC(81), KS_KP_Equal, 110 KC(82), KS_KP_Insert, KS_KP_0, 111 KC(83), KS_KP_End, KS_KP_1, 112 KC(84), KS_Cmd_ScrollSlowUp, KS_KP_Down, KS_KP_2, 113 KC(85), KS_Cmd_ScrollFastDown, KS_KP_Next, KS_KP_3, 114 KC(86), KS_KP_Left, KS_KP_4, 115 KC(87), KS_KP_Begin, KS_KP_5, 116 KC(88), KS_KP_Right, KS_KP_6, 117 KC(89), KS_KP_Home, KS_KP_7, 118 119 KC(91), KS_Cmd_ScrollSlowUp, KS_KP_Up, KS_KP_8, 120 KC(92), KS_Cmd_ScrollFastUp, KS_KP_Prior, KS_KP_9, 121 122 KC(95), KS_KP_Delete, KS_KP_Decimal, 123 KC(96), KS_Cmd_Screen4, KS_f5, 124 KC(97), KS_Cmd_Screen5, KS_f6, 125 KC(98), KS_Cmd_Screen6, KS_f7, 126 KC(99), KS_Cmd_Screen2, KS_f3, 127 KC(100),KS_Cmd_Screen7, KS_f8, 128 129 KC(101),KS_Cmd_Screen8, KS_f9, 130 131 KC(103), KS_f11, 132 133 KC(105), KS_Print_Screen, 134 KC(106), KS_KP_Enter, 135 KC(107), KS_Hold_Screen, 136 137 KC(109),KS_Cmd_Screen9, KS_f10, 138 139 KC(111), KS_f12, 140 141 KC(113), KS_Pause, 142 KC(114), KS_Insert, 143 KC(115), KS_Home, 144 KC(116), KS_Cmd_ScrollFastUp, KS_Prior, 145 KC(117), KS_Delete, /* BackSpace */ 146 KC(118),KS_Cmd_Screen3, KS_f4, 147 KC(119), KS_End, 148 KC(120),KS_Cmd_Screen1, KS_f2, 149 KC(121),KS_Cmd_ScrollFastDown, KS_Next, 150 KC(122),KS_Cmd_Screen0, KS_f1, 151 KC(123), KS_Shift_R, 152 KC(124), KS_Alt_R, 153 KC(125), KS_Control_R, 154 KC(127), KS_Cmd_Debugger, 155 }; 156 157 static const keysym_t akbd_keydesc_fr[] = { 158 /* pos normal shifted altgr shift-altgr */ 159 KC(0), KS_q, 160 KC(1), KS_s, KS_S, KS_Ograve, 161 KC(4), KS_h, KS_H, KS_Igrave, KS_Icircumflex, 162 KC(6), KS_w, KS_W, KS_less, KS_greater, 163 KC(8), KS_c, KS_C, KS_copyright, KS_cent, 164 KC(10), KS_at, KS_numbersign, 165 KC(11), KS_b, KS_B, KS_ssharp, 166 KC(12), KS_a, KS_A, KS_ae, KS_AE, 167 KC(13), KS_z, KS_Z, KS_Acircumflex, KS_Aring, 168 KC(14), KS_e, KS_E, KS_ecircumflex, KS_Ecircumflex, 169 KC(15), KS_r, KS_R, KS_registered, /* Euro */ 170 KC(16), KS_y, KS_Y, KS_Uacute, 171 KC(18), KS_ampersand, KS_1, KS_voidSymbol, KS_dead_acute, 172 KC(19), KS_eacute, KS_2, KS_ediaeresis, 173 KC(20), KS_quotedbl, KS_3, 174 KC(21), KS_apostrophe, KS_4, KS_braceleft, KS_bracketleft, 175 KC(22), KS_section, KS_6, KS_paragraph, 176 KC(23), KS_parenleft, KS_5, KS_braceleft, KS_bracketleft, 177 KC(24), KS_minus, KS_underscore, KS_braceright, 178 KC(25), KS_ccedilla, KS_9, KS_Ccedilla, KS_Agrave, 179 KC(26), KS_egrave, KS_7, KS_guillemotleft,KS_guillemotright, 180 KC(27), KS_parenright, KS_degree, KS_braceright, KS_bracketright, 181 KC(28), KS_exclam, KS_8, KS_exclamdown, KS_Ucircumflex, 182 KC(29), KS_agrave, KS_0, KS_oslash, 183 KC(30), KS_dollar, KS_asterisk, KS_comma, KS_yen, 184 KC(33), KS_dead_circumflex, KS_dead_diaeresis,KS_ocircumflex,KS_Ocircumflex, 185 KC(34), KS_i, KS_I, KS_icircumflex, KS_Icircumflex, 186 KC(37), KS_l, KS_L, KS_notsign, KS_bar, 187 KC(38), KS_j, KS_J, KS_Idiaeresis, KS_Igrave, 188 KC(39), KS_ugrave, KS_percent, KS_Ugrave, 189 KC(40), KS_k, KS_K, KS_Egrave, KS_Ediaeresis, 190 KC(41), KS_m, KS_M, KS_mu, KS_Ograve, 191 KC(42), KS_dead_grave, KS_sterling, KS_at, KS_numbersign, 192 KC(43), KS_semicolon, KS_period, 193 KC(44), KS_equal, KS_plus, KS_voidSymbol, KS_plusminus, 194 KC(45), KS_n, KS_N, KS_dead_tilde, 195 KC(46), KS_comma, KS_question, KS_voidSymbol, KS_questiondown, 196 KC(47), KS_colon, KS_slash, KS_division, KS_backslash, 197 KC(50), KS_less, KS_greater, 198 KC(52), KS_Alt_R, 199 KC(55), KS_Meta_L, /* Command */ 200 KC(58), KS_Mode_switch, KS_Multi_key, /* Option */ 201 }; 202 203 static const keysym_t akbd_keydesc_fr_nodead[] = { 204 KC(18), KS_ampersand, KS_1, KS_voidSymbol, KS_acute, 205 KC(33), KS_asciicircum, KS_diaeresis, KS_ocircumflex, KS_Ocircumflex, 206 KC(42), KS_grave, KS_sterling, KS_at, KS_numbersign, 207 KC(45), KS_n, KS_N, KS_asciitilde, 208 }; 209 210 static const keysym_t akbd_keydesc_jp[] = { 211 /* pos command normal shifted */ 212 KC(19), KS_2, KS_quotedbl, 213 KC(22), KS_6, KS_ampersand, 214 KC(24), KS_asciicircum, KS_asciitilde, 215 KC(25), KS_9, KS_parenright, 216 KC(26), KS_7, KS_apostrophe, 217 KC(27), KS_minus, KS_equal, 218 KC(28), KS_8, KS_parenleft, 219 KC(29), KS_0, 220 KC(30), KS_bracketleft, KS_braceleft, 221 KC(33), KS_at, KS_grave, 222 KC(39), KS_colon, KS_asterisk, 223 224 KC(41), KS_semicolon, KS_plus, 225 KC(42), KS_bracketright,KS_braceright, 226 KC(93), KS_backslash, KS_bar, 227 KC(94), KS_underscore, 228 }; 229 230 static const keysym_t akbd_keydesc_uk[] = { 231 /* pos normal shifted altgr shift-altgr */ 232 KC(10), KS_section, KS_plusminus, 233 KC(20), KS_3, KS_sterling, KS_numbersign, 234 KC(52), KS_KP_Enter, 235 KC(58), KS_Mode_switch, KS_Multi_key, /* Option */ 236 }; 237 238 static const keysym_t akbd_keydesc_sv[] = { 239 /* pos normal shifted altgr shift-altgr */ 240 KC(10), KS_section, KS_degree, 241 KC(19), KS_2, KS_quotedbl, KS_at, 242 KC(21), KS_4, KS_dollar, 243 KC(22), KS_6, KS_ampersand, 244 KC(24), KS_dead_acute, KS_dead_grave, 245 KC(25), KS_9, KS_parenright, KS_bracketright, 246 KC(26), KS_7, KS_slash, KS_braceleft, 247 KC(27), KS_plus, KS_question, KS_backslash, 248 KC(28), KS_8, KS_parenleft, KS_bracketleft, 249 KC(29), KS_0, KS_equal, KS_braceright, 250 KC(30), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde, 251 KC(33), KS_aring, 252 KC(39), KS_adiaeresis, 253 KC(41), KS_odiaeresis, 254 KC(42), KS_apostrophe, KS_asterisk, 255 KC(43), KS_comma, KS_semicolon, 256 KC(44), KS_minus, KS_underscore, 257 KC(47), KS_period, KS_colon, 258 KC(50), KS_less, KS_greater, KS_bar, 259 KC(58), KS_Mode_switch,KS_Multi_key, 260 }; 261 262 static const keysym_t akbd_keydesc_sv_nodead[] = { 263 /* pos normal shifted altgr shift-altgr */ 264 KC(24), KS_apostrophe, KS_grave, 265 KC(30), KS_diaeresis, KS_asciicircum, KS_asciitilde, 266 }; 267 268 static const keysym_t akbd_keydesc_de[] = { 269 /* pos normal shifted altgr shift-altgr */ 270 KC(0), KS_a, KS_A, KS_aring, KS_Aring, 271 KC(1), KS_s, KS_S, KS_voidSymbol, KS_Iacute, 272 KC(3), KS_f, KS_F, KS_voidSymbol, KS_Idiaeresis, 273 KC(4), KS_h, KS_H, KS_ordfeminine, KS_Oacute, 274 KC(5), KS_g, KS_G, KS_copyright, KS_Igrave, 275 KC(6), KS_y, KS_Y, KS_yen, 276 KC(7), KS_x, KS_X, KS_voidSymbol, KS_Ugrave, 277 KC(8), KS_c, KS_C, KS_ccedilla, KS_Ccedilla, 278 KC(10), KS_dead_circumflex,KS_degree, 279 KC(12), KS_q, KS_Q, KS_guillemotleft,KS_guillemotright, 280 KC(15), KS_r, KS_R, KS_registered, KS_cedilla, 281 KC(16), KS_z, KS_Z, 282 KC(18), KS_1, KS_exclam, KS_exclamdown, KS_notsign, 283 KC(19), KS_2, KS_quotedbl, 284 KC(20), KS_3, KS_section, KS_paragraph, KS_numbersign, 285 KC(21), KS_4, KS_dollar, KS_cent, KS_sterling, 286 KC(22), KS_6, KS_ampersand, KS_bracketright,KS_dead_circumflex, 287 KC(23), KS_5, KS_percent, KS_bracketleft, 288 KC(24), KS_dead_acute, KS_dead_grave, KS_apostrophe, 289 KC(25), KS_9, KS_parenright, KS_braceright, KS_periodcentered, 290 KC(26), KS_7, KS_slash, KS_bar, KS_backslash, 291 KC(27), KS_ssharp, KS_question, KS_questiondown, 292 KC(28), KS_8, KS_parenleft, KS_braceleft, 293 KC(29), KS_0, KS_equal, KS_voidSymbol, KS_macron, 294 KC(30), KS_plus, KS_asterisk, KS_plusminus, 295 KC(31), KS_o, KS_O, KS_oslash, KS_Ooblique, 296 KC(32), KS_u, KS_U, KS_dead_diaeresis,KS_Aacute, 297 KC(33), KS_udiaeresis, KS_Udiaeresis, KS_voidSymbol, KS_degree, 298 KC(34), KS_i, KS_I, KS_voidSymbol, KS_Ucircumflex, 299 KC(37), KS_l, KS_L, KS_at, 300 KC(38), KS_j, KS_J, KS_masculine, 301 KC(39), KS_adiaeresis, KS_Adiaeresis, KS_ae, KS_AE, 302 KC(41), KS_odiaeresis, KS_Odiaeresis, 303 KC(42), KS_numbersign, KS_apostrophe, 304 KC(43), KS_comma, KS_semicolon, 305 KC(44), KS_minus, KS_underscore, 306 KC(45), KS_n, KS_N, KS_dead_tilde, 307 KC(46), KS_m, KS_M, KS_mu, 308 KC(47), KS_period, KS_colon, 309 KC(50), KS_less, KS_greater, 310 KC(52), KS_Multi_key, 311 KC(58), KS_Mode_switch, 312 }; 313 314 static const keysym_t akbd_keydesc_de_nodead[] = { 315 /* pos normal shifted altgr shift-altgr */ 316 KC(10), KS_asciicircum, KS_degree, 317 KC(22), KS_6, KS_ampersand, KS_bracketright,KS_asciicircum, 318 KC(24), KS_acute, KS_grave, KS_apostrophe, 319 KC(32), KS_u, KS_U, KS_diaeresis, KS_Aacute, 320 KC(45), KS_n, KS_N, KS_asciitilde, 321 }; 322 323 static const keysym_t akbd_keydesc_sf[] = { 324 /* pos normal shifted altgr shift-altgr */ 325 KC(6), KS_y, 326 KC(10), KS_paragraph, KS_degree, 327 KC(16), KS_z, 328 KC(18), KS_plus, KS_1, 329 KC(19), KS_quotedbl, KS_2, 330 KC(20), KS_asterisk, KS_3, 331 KC(21), KS_ccedilla, KS_4, KS_Ccedilla, 332 KC(22), KS_ampersand, KS_6, 333 KC(23), KS_percent, KS_5, 334 KC(24), KS_dead_circumflex,KS_grave, 335 KC(25), KS_parenright, KS_9, 336 KC(26), KS_slash, KS_7, 337 KC(27), KS_apostrophe, KS_question, 338 KC(28), KS_parenleft, KS_8, 339 KC(29), KS_equal, KS_0, 340 KC(30), KS_dead_diaeresis,KS_exclam, 341 KC(33), KS_egrave, KS_udiaeresis, 342 KC(39), KS_agrave, KS_adiaeresis, 343 KC(41), KS_eacute, KS_odiaeresis, 344 KC(42), KS_dollar, KS_sterling, 345 KC(43), KS_period, KS_colon, 346 KC(46), KS_comma, KS_semicolon, 347 KC(47), KS_minus, KS_underscore, 348 KC(50), KS_less, KS_greater, 349 }; 350 351 static const keysym_t akbd_keydesc_es[] = { 352 /* pos normal shifted altgr shift-altgr */ 353 KC(10), KS_degree, KS_ordfeminine, KS_backslash, 354 KC(18), KS_1, KS_exclam, KS_bar, 355 KC(19), KS_2, KS_quotedbl, KS_at, 356 KC(20), KS_3, KS_periodcentered, KS_numbersign, 357 KC(21), KS_4, KS_dollar, KS_asciitilde, 358 KC(22), KS_6, KS_ampersand, KS_notsign, 359 KC(23), KS_5, KS_percent, 360 KC(24), KS_exclamdown, KS_questiondown, 361 KC(25), KS_9, KS_parenright, 362 KC(26), KS_7, KS_slash, 363 KC(27), KS_apostrophe, KS_question, 364 KC(28), KS_8, KS_parenleft, 365 KC(29), KS_0, KS_equal, 366 KC(30), KS_plus, KS_asterisk, KS_bracketright, 367 KC(33), KS_dead_grave, KS_dead_circumflex, KS_bracketleft, 368 KC(39), KS_dead_acute, KS_dead_diaeresis, KS_braceleft, 369 KC(41), KS_ntilde, 370 KC(42), KS_ccedilla, KS_Ccedilla, KS_braceright, 371 KC(43), KS_comma, KS_semicolon, 372 KC(44), KS_minus, KS_underscore, 373 KC(47), KS_period, KS_colon, 374 KC(50), KS_less, KS_greater, 375 KC(55), KS_Alt_L, /* Command */ 376 KC(58), KS_Mode_switch, KS_Multi_key, /* Option */ 377 }; 378 379 static const keysym_t akbd_keydesc_pt[] = { 380 /* pos normal shifted altgr shift-altgr */ 381 KC(7), KS_x, KS_X, KS_guillemotleft, KS_guillemotright, 382 KC(10), KS_section, KS_plusminus, 383 KC(19), KS_2, KS_quotedbl, KS_at, 384 KC(20), KS_3, KS_numbersign, KS_sterling, 385 KC(22), KS_6, KS_ampersand, 386 KC(24), KS_plus, KS_asterisk, 387 KC(25), KS_9, KS_parenright, KS_bracketright, KS_braceright, 388 KC(26), KS_7, KS_slash, 389 KC(27), KS_apostrophe, KS_question, 390 KC(28), KS_8, KS_parenleft, KS_bracketleft, KS_braceleft, 391 KC(29), KS_0, KS_equal, 392 KC(30), KS_dead_acute, KS_dead_grave, 393 KC(33), KS_masculine, KS_ordfeminine, 394 KC(39), KS_dead_tilde, KS_dead_circumflex, 395 KC(41), KS_ccedilla, KS_Ccedilla, 396 KC(43), KS_comma, KS_semicolon, 397 KC(44), KS_minus, KS_underscore, 398 KC(47), KS_period, KS_colon, 399 KC(50), KS_less, KS_greater, 400 KC(58), KS_Mode_switch, 401 KC(81), KS_KP_Equal, 402 }; 403 404 #define KBD_MAP(name, base, map) \ 405 { name, base, sizeof(map)/sizeof(keysym_t), map } 406 407 static const struct wscons_keydesc akbd_keydesctab[] = { 408 KBD_MAP(KB_US, 0, akbd_keydesc_us), 409 KBD_MAP(KB_FR, KB_US, akbd_keydesc_fr), 410 KBD_MAP(KB_JP, KB_US, akbd_keydesc_jp), 411 KBD_MAP(KB_FR | KB_NODEAD, KB_FR, akbd_keydesc_fr_nodead), 412 KBD_MAP(KB_SF, KB_US, akbd_keydesc_sf), 413 KBD_MAP(KB_SV, KB_US, akbd_keydesc_sv), 414 KBD_MAP(KB_SV | KB_NODEAD, KB_SV, akbd_keydesc_sv_nodead), 415 KBD_MAP(KB_DE, KB_US, akbd_keydesc_de), 416 KBD_MAP(KB_DE | KB_NODEAD, KB_DE, akbd_keydesc_de_nodead), 417 KBD_MAP(KB_UK, KB_US, akbd_keydesc_uk), 418 KBD_MAP(KB_ES, KB_US, akbd_keydesc_es), 419 KBD_MAP(KB_PT, KB_US, akbd_keydesc_pt), 420 {0, 0, 0, 0} 421 }; 422 423 #undef KBD_MAP 424 #undef KC 425 426 extern keysym_t adb_to_usb[]; 427