hilkbdmap.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. /* $OpenBSD: hilkbdmap.c,v 1.7 2005/05/07 22:42:30 miod Exp $ */
  2. /*
  3. * Copyright (c) 2003, Miodrag Vallat.
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  16. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  19. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  21. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  22. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  23. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  24. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  25. * POSSIBILITY OF SUCH DAMAGE.
  26. *
  27. */
  28. #include <sys/types.h>
  29. #include <dev/wscons/wsksymdef.h>
  30. #include <dev/wscons/wsksymvar.h>
  31. #include <dev/hil/hilkbdmap.h>
  32. #ifdef WSDISPLAY_COMPAT_RAWKBD
  33. #include <dev/wscons/wskbdraw.h>
  34. /*
  35. * Translate HIL keycodes to US keyboard XT scancodes, for proper
  36. * X11-over-wsmux operation.
  37. */
  38. const u_int8_t hilkbd_raw[0x80] = {
  39. RAWKEY_Control_R,
  40. RAWKEY_Null,
  41. RAWKEY_Alt_R,
  42. RAWKEY_Alt_L,
  43. RAWKEY_Shift_R,
  44. RAWKEY_Shift_L,
  45. RAWKEY_Control_L,
  46. RAWKEY_Pause, /* 7 Break/Reset */
  47. RAWKEY_KP_Left,
  48. RAWKEY_KP_Up,
  49. RAWKEY_KP_Begin,
  50. RAWKEY_KP_Prior,
  51. RAWKEY_KP_Right,
  52. RAWKEY_KP_Home,
  53. RAWKEY_KP_Delete,
  54. RAWKEY_KP_Enter,
  55. RAWKEY_KP_End,
  56. RAWKEY_KP_Divide,
  57. RAWKEY_KP_Down,
  58. RAWKEY_KP_Add,
  59. RAWKEY_KP_Next,
  60. RAWKEY_KP_Multiply,
  61. RAWKEY_KP_Insert,
  62. RAWKEY_KP_Subtract,
  63. RAWKEY_b,
  64. RAWKEY_v,
  65. RAWKEY_c,
  66. RAWKEY_x,
  67. RAWKEY_z,
  68. RAWKEY_Null, /* 29 Kanji Left */
  69. RAWKEY_Null, /* 30 */
  70. RAWKEY_Escape,
  71. RAWKEY_Null,
  72. RAWKEY_f10,
  73. RAWKEY_Null,
  74. RAWKEY_f11,
  75. RAWKEY_KP_Delete,
  76. RAWKEY_f9,
  77. RAWKEY_Tab,
  78. RAWKEY_f12,
  79. RAWKEY_h,
  80. RAWKEY_g,
  81. RAWKEY_f,
  82. RAWKEY_d,
  83. RAWKEY_s,
  84. RAWKEY_a,
  85. RAWKEY_Null, /* 46 */
  86. RAWKEY_Caps_Lock,
  87. RAWKEY_u,
  88. RAWKEY_y,
  89. RAWKEY_t,
  90. RAWKEY_r,
  91. RAWKEY_e,
  92. RAWKEY_w,
  93. RAWKEY_q,
  94. RAWKEY_Tab,
  95. RAWKEY_7,
  96. RAWKEY_6,
  97. RAWKEY_5,
  98. RAWKEY_4,
  99. RAWKEY_3,
  100. RAWKEY_2,
  101. RAWKEY_1,
  102. RAWKEY_grave,
  103. RAWKEY_Null, /* 64 */
  104. RAWKEY_Null, /* 65 */
  105. RAWKEY_Null, /* 66 */
  106. RAWKEY_Null, /* 67 */
  107. RAWKEY_Null, /* 68 */
  108. RAWKEY_Null, /* 69 */
  109. RAWKEY_Null, /* 70 */
  110. RAWKEY_Null, /* 71 */
  111. RAWKEY_Print_Screen,
  112. RAWKEY_f4,
  113. RAWKEY_f3,
  114. RAWKEY_f2,
  115. RAWKEY_f1,
  116. RAWKEY_Null, /* 77 */
  117. RAWKEY_Hold_Screen,
  118. RAWKEY_Return,
  119. RAWKEY_Num_Lock,
  120. RAWKEY_f5,
  121. RAWKEY_f6,
  122. RAWKEY_f7,
  123. RAWKEY_f8,
  124. RAWKEY_Null, /* 85 */
  125. RAWKEY_Null, /* 86 Clear line */
  126. RAWKEY_Null, /* 87 Clear display */
  127. RAWKEY_8,
  128. RAWKEY_9,
  129. RAWKEY_0,
  130. RAWKEY_minus,
  131. RAWKEY_equal,
  132. RAWKEY_BackSpace,
  133. RAWKEY_Null, /* 94 Insert line */
  134. RAWKEY_Null, /* 95 Delete line */
  135. RAWKEY_i,
  136. RAWKEY_o,
  137. RAWKEY_p,
  138. RAWKEY_bracketleft,
  139. RAWKEY_bracketright,
  140. RAWKEY_backslash,
  141. RAWKEY_Insert,
  142. RAWKEY_Delete,
  143. RAWKEY_j,
  144. RAWKEY_k,
  145. RAWKEY_l,
  146. RAWKEY_semicolon,
  147. RAWKEY_apostrophe,
  148. RAWKEY_Return,
  149. RAWKEY_Home,
  150. RAWKEY_Prior,
  151. RAWKEY_m,
  152. RAWKEY_comma,
  153. RAWKEY_period,
  154. RAWKEY_slash,
  155. RAWKEY_Null, /* 116 */
  156. RAWKEY_End,
  157. RAWKEY_Null, /* 118 */
  158. RAWKEY_Next,
  159. RAWKEY_n,
  160. RAWKEY_space,
  161. RAWKEY_Null, /* 122 */
  162. RAWKEY_Null, /* 123 Kanji Right */
  163. RAWKEY_Left,
  164. RAWKEY_Down,
  165. RAWKEY_Up,
  166. RAWKEY_Right
  167. };
  168. #endif
  169. #define KC(n) KS_KEYCODE(n)
  170. /*
  171. * 1f. US ASCII
  172. *
  173. * We use the same table for PS/2 and old HIL keyboards, as the only
  174. * differences are a few keys which are only present in one of both layouts,
  175. * and the one-function-only keypad in the old HIL flavour (hilkbd.c knows
  176. * about this and does The Right Thing).
  177. */
  178. static const keysym_t hilkbd_keydesc_us[] = {
  179. /* pos command normal shifted */
  180. KC(0), KS_Cmd1, KS_Control_R,
  181. KC(2), KS_Cmd2, KS_Mode_switch, KS_Multi_key,
  182. KC(3), KS_Cmd2, KS_Alt_L,
  183. KC(4), KS_Shift_R,
  184. KC(5), KS_Shift_L,
  185. KC(6), KS_Cmd1, KS_Control_L,
  186. KC(7), KS_Cmd_KbdReset, /* Break/Reset */
  187. KC(8), KS_KP_Left, KS_KP_4,
  188. KC(9), KS_KP_Up, KS_KP_8,
  189. KC(10), KS_KP_Begin, KS_KP_5,
  190. KC(11), KS_KP_Prior, KS_KP_9,
  191. KC(12), KS_KP_Right, KS_KP_6,
  192. KC(13), KS_KP_Home, KS_KP_7,
  193. KC(14), KS_KP_Separator,
  194. KC(15), KS_KP_Enter,
  195. KC(16), KS_KP_End, KS_KP_1,
  196. KC(17), KS_KP_Divide,
  197. KC(18), KS_KP_Down, KS_KP_2,
  198. KC(19), KS_KP_Add,
  199. KC(20), KS_KP_Next, KS_KP_3,
  200. KC(21), KS_KP_Multiply,
  201. KC(22), KS_KP_Insert, KS_KP_0,
  202. KC(23), KS_KP_Subtract,
  203. KC(24), KS_b,
  204. KC(25), KS_v, KS_V, KS_section,
  205. KC(26), KS_c, KS_C, KS_ccedilla,
  206. KC(27), KS_x, KS_X, KS_L2_scaron,
  207. KC(28), KS_z, KS_Z, KS_paragraph,
  208. /* 29 Kanji Left */
  209. KC(31), KS_Cmd_Debugger, KS_Escape, KS_Delete,
  210. KC(33), KS_Cmd_Screen9, KS_f10, /* also KS_KP_F2 */
  211. KC(35), KS_Cmd_Screen10, KS_f11, /* also KS_KP_F3 */
  212. KC(36), KS_KP_Delete, KS_KP_Decimal,
  213. KC(37), KS_Cmd_Screen8, KS_f9, /* also KS_KP_F1 */
  214. KC(38), KS_Tab, /* numeric pad */
  215. KC(39), KS_Cmd_Screen11, KS_f12, /* also KS_KP_F4 */
  216. KC(40), KS_h, KS_H, KS_yen,
  217. KC(41), KS_g, KS_G, KS_currency,
  218. KC(42), KS_f,
  219. KC(43), KS_d, KS_D, KS_eth,
  220. KC(44), KS_s, KS_S, KS_ssharp,
  221. KC(45), KS_a, KS_A, KS_aring,
  222. /* 46 Mode_Switch ??? */
  223. KC(47), KS_Caps_Lock,
  224. KC(48), KS_u, KS_U, KS_dead_diaeresis,
  225. KC(49), KS_y, KS_Y, KS_dead_circumflex,
  226. KC(50), KS_t, KS_T, KS_dead_grave,
  227. KC(51), KS_r, KS_R, KS_dead_acute,
  228. KC(52), KS_e, KS_E, KS_ae,
  229. KC(53), KS_w, KS_W, KS_asciitilde,
  230. KC(54), KS_q, KS_Q, KS_periodcentered,
  231. KC(55), KS_Tab,
  232. KC(56), KS_7, KS_ampersand, KS_backslash,
  233. KC(57), KS_6, KS_asciicircum, KS_asciicircum,
  234. KC(58), KS_5, KS_percent, KS_onehalf,
  235. KC(59), KS_4, KS_dollar,
  236. KS_onequarter, KS_threequarters,
  237. KC(60), KS_3, KS_numbersign, KS_numbersign,
  238. KC(61), KS_2, KS_at, KS_at,
  239. KC(62), KS_1, KS_exclam, KS_exclamdown,
  240. KC(63), KS_grave, KS_asciitilde,
  241. KS_guillemotleft,KS_guillemotright,
  242. KC(72), KS_Print_Screen, /* Menu */
  243. KC(73), KS_Cmd_Screen3, KS_f4,
  244. KC(74), KS_Cmd_Screen2, KS_f3,
  245. KC(75), KS_Cmd_Screen1, KS_f2,
  246. KC(76), KS_Cmd_Screen0, KS_f1,
  247. KC(78), KS_Hold_Screen,
  248. KC(79), KS_Return, KS_Print_Screen,
  249. KC(80), KS_Num_Lock, /* System/User */
  250. KC(81), KS_Cmd_Screen4, KS_f5,
  251. KC(82), KS_Cmd_Screen5, KS_f6,
  252. KC(83), KS_Cmd_Screen6, KS_f7,
  253. KC(84), KS_Cmd_Screen7, KS_f8,
  254. /* 86 Clear line */
  255. KC(87), KS_Clear,
  256. KC(88), KS_8, KS_asterisk,
  257. KS_bracketleft, KS_braceleft,
  258. KC(89), KS_9, KS_parenleft,
  259. KS_bracketright,KS_braceright,
  260. KC(90), KS_0, KS_parenright, KS_questiondown,
  261. KC(91), KS_minus, KS_underscore, KS_macron,
  262. KC(92), KS_equal, KS_plus, KS_plusminus,
  263. KC(93), KS_Cmd_ResetEmul, KS_Delete, /* Backspace */
  264. /* 94 Insert line */
  265. /* 95 Delete line */
  266. KC(96), KS_i, KS_I, KS_dead_tilde,
  267. KC(97), KS_o, KS_O, KS_oslash,
  268. KC(98), KS_p, KS_P, KS_thorn,
  269. KC(99), KS_bracketleft, KS_braceleft, KS_degree,
  270. KC(100), KS_bracketright,KS_braceright,
  271. KS_bar, KS_brokenbar,
  272. KC(101), KS_backslash, KS_bar, KS_mu,
  273. KC(102), KS_Insert,
  274. KC(103), KS_Delete,
  275. KC(104), KS_j, KS_J, KS_dollar,
  276. KC(105), KS_k, KS_K, KS_cent,
  277. KC(106), KS_l, KS_L, KS_sterling,
  278. KC(107), KS_semicolon, KS_colon,
  279. KC(108), KS_apostrophe, KS_quotedbl,
  280. KS_grave, KS_apostrophe,
  281. KC(109), KS_Return,
  282. KC(110), KS_Home,
  283. KC(111), KS_Cmd_ScrollBack, KS_Prior,
  284. KC(112), KS_m, KS_M, KS_masculine,
  285. KC(113), KS_comma, KS_less, KS_less,
  286. KC(114), KS_period, KS_greater, KS_greater,
  287. KC(115), KS_slash, KS_question, KS_underscore,
  288. KC(117), KS_End, /* Select */
  289. KC(119), KS_Cmd_ScrollFwd, KS_Next,
  290. KC(120), KS_n, KS_N, KS_ordfeminine,
  291. KC(121), KS_space,
  292. /* 123 Kanji Right */
  293. KC(124), KS_Left,
  294. KC(125), KS_Down,
  295. KC(126), KS_Up,
  296. KC(127), KS_Right,
  297. };
  298. /*
  299. * 0e. Swedish
  300. */
  301. static const keysym_t hilkbd_keydesc_sv[] = {
  302. KC(56), KS_7, KS_slash, KS_backslash,
  303. KC(57), KS_6, KS_ampersand, KS_asciicircum,
  304. KC(61), KS_2, KS_quotedbl, KS_at,
  305. KC(63), KS_less, KS_greater,
  306. KS_guillemotleft,KS_guillemotright,
  307. KC(88), KS_8, KS_parenleft, KS_bracketleft, KS_braceleft,
  308. KC(89), KS_9, KS_parenright, KS_bracketright,KS_braceright,
  309. KC(90), KS_0, KS_equal, KS_exclamdown,
  310. KC(91), KS_plus, KS_question, KS_macron,
  311. KC(92), KS_eacute, KS_Eacute, KS_plusminus,
  312. KC(97), KS_aring, KS_Aring, KS_degree,
  313. KC(98), KS_udiaeresis, KS_Udiaeresis, KS_bar, KS_brokenbar,
  314. KC(99), KS_apostrophe, KS_asterisk, KS_mu,
  315. KC(107), KS_odiaeresis,
  316. KC(108), KS_adiaeresis, KS_Adiaeresis, KS_grave, KS_apostrophe,
  317. KC(113), KS_comma, KS_semicolon, KS_less,
  318. KC(114), KS_period, KS_colon, KS_greater,
  319. KC(115), KS_minus, KS_underscore, KS_underscore
  320. };
  321. static const keysym_t hilkbd_keydesc_sv_nodead[] = {
  322. KC(48), KS_u, KS_U, KS_diaeresis,
  323. KC(49), KS_y, KS_Y, KS_asciicircum,
  324. KC(50), KS_t, KS_T, KS_grave,
  325. KC(51), KS_r, KS_R, KS_apostrophe,
  326. KC(96), KS_i, KS_I, KS_asciitilde,
  327. };
  328. static const keysym_t hilkbd_keydesc_sv_ps2[] = {
  329. KC(24), KS_b,
  330. KC(25), KS_v,
  331. KC(26), KS_c,
  332. KC(27), KS_x,
  333. KC(28), KS_z,
  334. KC(36), KS_KP_Separator,KS_KP_Delete,
  335. KC(40), KS_h,
  336. KC(41), KS_g,
  337. KC(42), KS_f,
  338. KC(43), KS_d,
  339. KC(44), KS_s,
  340. KC(45), KS_a,
  341. KC(48), KS_u,
  342. KC(49), KS_y,
  343. KC(50), KS_t,
  344. KC(51), KS_r,
  345. KC(52), KS_e,
  346. KC(53), KS_w,
  347. KC(54), KS_q,
  348. KC(56), KS_7, KS_slash, KS_braceleft,
  349. KC(57), KS_6, KS_ampersand,
  350. KC(58), KS_5, KS_percent,
  351. KC(59), KS_4, KS_currency, KS_dollar,
  352. KC(60), KS_3, KS_numbersign, KS_sterling,
  353. KC(61), KS_2, KS_quotedbl, KS_at,
  354. KC(62), KS_1, KS_exclam,
  355. KC(63), KS_section, KS_onehalf,
  356. KC(88), KS_8, KS_parenleft, KS_bracketleft,
  357. KC(89), KS_9, KS_parenright, KS_bracketright,
  358. KC(90), KS_0, KS_equal, KS_braceright,
  359. KC(91), KS_minus, KS_question, KS_backslash,
  360. KC(92), KS_dead_acute, KS_dead_grave,
  361. KC(96), KS_i,
  362. KC(97), KS_o,
  363. KC(98), KS_p,
  364. KC(99), KS_aring,
  365. KC(100), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
  366. KC(104), KS_j,
  367. KC(105), KS_k,
  368. KC(106), KS_l,
  369. KC(107), KS_odiaeresis,
  370. KC(108), KS_adiaeresis,
  371. KC(112), KS_m,
  372. KC(113), KS_comma, KS_semicolon,
  373. KC(114), KS_period, KS_colon,
  374. KC(115), KS_minus, KS_underscore,
  375. KC(116), KS_apostrophe, KS_asterisk,
  376. KC(118), KS_less, KS_greater, KS_bar,
  377. KC(120), KS_n
  378. };
  379. static const keysym_t hilkbd_keydesc_sv_ps2_nodead[] = {
  380. KC(92), KS_apostrophe, KS_grave,
  381. KC(100), KS_diaeresis, KS_asciicircum, KS_asciitilde,
  382. };
  383. /*
  384. * 0f. German
  385. */
  386. static const keysym_t hilkbd_keydesc_de[] = {
  387. KC(28), KS_y, KS_Y, KS_paragraph,
  388. KC(49), KS_z, KS_Z, KS_dead_circumflex,
  389. KC(56), KS_7, KS_slash, KS_backslash,
  390. KC(57), KS_6, KS_ampersand, KS_asciicircum,
  391. KC(60), KS_3, KS_section, KS_numbersign,
  392. KC(61), KS_2, KS_quotedbl, KS_at,
  393. KC(63), KS_less, KS_greater,
  394. KS_guillemotleft,KS_guillemotright,
  395. KC(88), KS_8, KS_parenleft,
  396. KS_bracketleft, KS_braceleft,
  397. KC(89), KS_9, KS_parenright,
  398. KS_bracketright,KS_braceright,
  399. KC(90), KS_0, KS_equal, KS_exclamdown,
  400. KC(91), KS_ssharp, KS_question, KS_macron,
  401. KC(92), KS_dead_acute, KS_dead_grave, KS_plusminus,
  402. KC(99), KS_udiaeresis, KS_Udiaeresis, KS_dead_abovering,
  403. KC(100), KS_plus, KS_asterisk, KS_bar, KS_brokenbar,
  404. KC(101), KS_sterling, KS_dead_circumflex,KS_mu,
  405. KC(107), KS_odiaeresis,
  406. KC(108), KS_adiaeresis, KS_Adiaeresis, KS_grave, KS_apostrophe,
  407. KC(113), KS_comma, KS_semicolon, KS_less,
  408. KC(114), KS_period, KS_colon, KS_greater,
  409. KC(115), KS_minus, KS_underscore, KS_underscore
  410. };
  411. static const keysym_t hilkbd_keydesc_de_nodead[] = {
  412. KC(48), KS_u, KS_U, KS_diaeresis,
  413. KC(49), KS_z, KS_Z, KS_asciicircum,
  414. KC(50), KS_t, KS_T, KS_grave,
  415. KC(51), KS_r, KS_R, KS_apostrophe,
  416. KC(92), KS_apostrophe, KS_grave, KS_plusminus,
  417. KC(99), KS_udiaeresis, KS_Udiaeresis, KS_degree,
  418. KC(101), KS_sterling, KS_asciicircum, KS_mu,
  419. KC(96), KS_i, KS_I, KS_asciitilde
  420. };
  421. static const keysym_t hilkbd_keydesc_de_ps2[] = {
  422. KC(24), KS_b,
  423. KC(25), KS_v,
  424. KC(26), KS_c,
  425. KC(27), KS_x,
  426. KC(28), KS_y,
  427. KC(36), KS_KP_Separator,KS_KP_Delete,
  428. KC(40), KS_h,
  429. KC(41), KS_g,
  430. KC(42), KS_f,
  431. KC(43), KS_d,
  432. KC(44), KS_s,
  433. KC(45), KS_a,
  434. KC(48), KS_u,
  435. KC(49), KS_z, KS_Z, KS_dead_circumflex,
  436. KC(50), KS_t,
  437. KC(51), KS_r,
  438. KC(52), KS_e,
  439. KC(53), KS_w,
  440. KC(54), KS_q, KS_Q, KS_at,
  441. KC(56), KS_7, KS_slash, KS_braceleft,
  442. KC(57), KS_6, KS_ampersand,
  443. KC(58), KS_5, KS_percent,
  444. KC(59), KS_4, KS_dollar,
  445. KC(60), KS_3, KS_section, KS_threesuperior,
  446. KC(61), KS_2, KS_quotedbl, KS_twosuperior,
  447. KC(62), KS_1, KS_exclam,
  448. KC(63), KS_dead_circumflex, KS_dead_abovering,
  449. KC(88), KS_8, KS_parenleft, KS_bracketleft,
  450. KC(89), KS_9, KS_parenright, KS_bracketright,
  451. KC(90), KS_0, KS_equal, KS_braceright,
  452. KC(91), KS_ssharp, KS_question, KS_backslash,
  453. KC(92), KS_dead_acute, KS_dead_grave,
  454. KC(96), KS_i,
  455. KC(97), KS_o,
  456. KC(98), KS_p,
  457. KC(99), KS_udiaeresis,
  458. KC(100), KS_plus, KS_asterisk, KS_dead_tilde,
  459. KC(104), KS_j,
  460. KC(105), KS_k,
  461. KC(106), KS_l,
  462. KC(107), KS_odiaeresis,
  463. KC(108), KS_adiaeresis,
  464. KC(112), KS_m, KS_M, KS_mu,
  465. KC(113), KS_comma, KS_semicolon,
  466. KC(114), KS_period, KS_colon,
  467. KC(115), KS_minus, KS_underscore,
  468. KC(116), KS_numbersign, KS_apostrophe,
  469. KC(118), KS_less, KS_greater, KS_bar,
  470. KC(120), KS_n
  471. };
  472. static const keysym_t hilkbd_keydesc_de_ps2_nodead[] = {
  473. KC(49), KS_z, KS_Z, KS_asciicircum,
  474. KC(63), KS_asciicircum, KS_degree,
  475. KC(92), KS_apostrophe, KS_grave,
  476. KC(100), KS_plus, KS_asterisk, KS_asciitilde
  477. };
  478. /*
  479. * 17. English
  480. */
  481. static const keysym_t hilkbd_keydesc_uk[] = {
  482. KC(56), KS_7, KS_asciicircum, KS_backslash,
  483. KC(57), KS_6, KS_ampersand, KS_asciicircum,
  484. KC(60), KS_3, KS_sterling, KS_numbersign,
  485. KC(61), KS_2, KS_quotedbl, KS_at,
  486. KC(88), KS_8, KS_parenleft, KS_bracketleft, KS_braceleft,
  487. KC(89), KS_9, KS_parenright, KS_bracketright,KS_braceright,
  488. KC(90), KS_0, KS_equal, KS_questiondown,
  489. KC(91), KS_plus, KS_question, KS_macron,
  490. KC(92), KS_apostrophe, KS_slash, KS_plusminus,
  491. KC(101), KS_less, KS_greater, KS_mu,
  492. KC(107), KS_asterisk, KS_at,
  493. KC(108), KS_backslash, KS_bar, KS_grave, KS_apostrophe,
  494. KC(113), KS_comma, KS_semicolon, KS_less,
  495. KC(114), KS_period, KS_colon, KS_greater,
  496. KC(115), KS_minus, KS_underscore, KS_underscore
  497. };
  498. static const keysym_t hilkbd_keydesc_uk_ps2[] = {
  499. KC(24), KS_b,
  500. KC(25), KS_v,
  501. KC(26), KS_c,
  502. KC(27), KS_x,
  503. KC(28), KS_z,
  504. KC(40), KS_h,
  505. KC(41), KS_g,
  506. KC(42), KS_f,
  507. KC(43), KS_d,
  508. KC(44), KS_s,
  509. KC(45), KS_a,
  510. KC(48), KS_u,
  511. KC(49), KS_y,
  512. KC(50), KS_t,
  513. KC(51), KS_r,
  514. KC(52), KS_e,
  515. KC(53), KS_w,
  516. KC(54), KS_q,
  517. KC(56), KS_7, KS_ampersand,
  518. KC(57), KS_6, KS_asciicircum,
  519. KC(58), KS_5, KS_percent,
  520. KC(59), KS_4, KS_dollar,
  521. KC(60), KS_3, KS_sterling,
  522. KC(61), KS_2, KS_quotedbl,
  523. KC(62), KS_1, KS_exclam,
  524. KC(63), KS_grave, KS_notsign, KS_bar,
  525. KC(88), KS_8, KS_asterisk,
  526. KC(89), KS_9, KS_parenleft,
  527. KC(90), KS_0, KS_parenright,
  528. KC(91), KS_minus, KS_underscore,
  529. KC(92), KS_equal, KS_plus,
  530. KC(96), KS_i,
  531. KC(97), KS_o,
  532. KC(98), KS_p,
  533. KC(99), KS_bracketleft, KS_braceleft,
  534. KC(100), KS_bracketright,KS_braceright,
  535. KC(104), KS_j,
  536. KC(105), KS_k,
  537. KC(106), KS_l,
  538. KC(107), KS_semicolon, KS_colon,
  539. KC(108), KS_apostrophe, KS_at,
  540. KC(112), KS_m,
  541. KC(113), KS_comma, KS_less,
  542. KC(114), KS_period, KS_greater,
  543. KC(115), KS_slash, KS_question,
  544. KC(116), KS_numbersign, KS_asciitilde,
  545. KC(118), KS_backslash, KS_brokenbar,
  546. KC(120), KS_n
  547. };
  548. /*
  549. * 1b. French
  550. */
  551. static const keysym_t hilkbd_keydesc_fr[] = {
  552. KC(28), KS_w, KS_W, KS_paragraph,
  553. KC(45), KS_q, KS_Q, KS_aring,
  554. KC(53), KS_z, KS_Z, KS_asciitilde,
  555. KC(54), KS_a, KS_A, KS_periodcentered,
  556. KC(56), KS_egrave, KS_7, KS_backslash,
  557. KC(57), KS_section, KS_6, KS_asciicircum,
  558. KC(58), KS_parenleft, KS_5, KS_onehalf,
  559. KC(59), KS_apostrophe, KS_4, KS_onequarter, KS_threequarters,
  560. KC(60), KS_quotedbl, KS_3, KS_numbersign,
  561. KC(61), KS_eacute, KS_2, KS_at,
  562. KC(62), KS_ampersand, KS_1, KS_exclamdown,
  563. KC(63), KS_dollar, KS_sterling,
  564. KS_guillemotleft,KS_guillemotright,
  565. KC(88), KS_exclam, KS_8, KS_bracketleft, KS_braceleft,
  566. KC(89), KS_ccedilla, KS_9, KS_bracketright,KS_braceright,
  567. KC(90), KS_agrave, KS_0, KS_questiondown,
  568. KC(91), KS_parenright, KS_degree, KS_macron,
  569. KC(92), KS_minus, KS_underscore, KS_plusminus,
  570. KC(99), KS_dead_circumflex, KS_dead_diaeresis, KS_dead_abovering,
  571. KC(100), KS_grave, KS_asterisk, KS_bar, KS_brokenbar,
  572. KC(101), KS_less, KS_greater, KS_mu,
  573. KC(107), KS_m,
  574. KC(108), KS_ugrave, KS_percent, KS_grave, KS_apostrophe,
  575. KC(112), KS_comma, KS_question, KS_masculine,
  576. KC(113), KS_semicolon, KS_period, KS_less,
  577. KC(114), KS_colon, KS_slash, KS_greater,
  578. KC(115), KS_equal, KS_plus, KS_underscore
  579. };
  580. static const keysym_t hilkbd_keydesc_fr_ps2[] = {
  581. KC(24), KS_b,
  582. KC(25), KS_v,
  583. KC(26), KS_c,
  584. KC(27), KS_x,
  585. KC(28), KS_w,
  586. KC(40), KS_h,
  587. KC(41), KS_g,
  588. KC(42), KS_f,
  589. KC(43), KS_d,
  590. KC(44), KS_s,
  591. KC(45), KS_q,
  592. KC(48), KS_u,
  593. KC(49), KS_y,
  594. KC(50), KS_t,
  595. KC(51), KS_r,
  596. KC(52), KS_e,
  597. KC(53), KS_z,
  598. KC(54), KS_a,
  599. KC(56), KS_egrave, KS_7, KS_grave,
  600. KC(57), KS_minus, KS_6, KS_bar,
  601. KC(58), KS_parenleft, KS_5, KS_bracketleft,
  602. KC(59), KS_apostrophe, KS_4, KS_braceleft,
  603. KC(60), KS_quotedbl, KS_3, KS_numbersign,
  604. KC(61), KS_eacute, KS_2, KS_asciitilde,
  605. KC(62), KS_ampersand, KS_1,
  606. KC(63), KS_twosuperior,
  607. KC(88), KS_underscore, KS_8, KS_backslash,
  608. KC(89), KS_ccedilla, KS_9, KS_asciicircum,
  609. KC(90), KS_agrave, KS_0, KS_at,
  610. KC(91), KS_parenright, KS_degree, KS_bracketright,
  611. KC(92), KS_equal, KS_plus, KS_braceright,
  612. KC(96), KS_i,
  613. KC(97), KS_o,
  614. KC(98), KS_p,
  615. KC(99), KS_dead_circumflex,KS_dead_diaeresis,
  616. KC(100), KS_dollar, KS_sterling, KS_currency,
  617. KC(104), KS_j,
  618. KC(105), KS_k,
  619. KC(106), KS_l,
  620. KC(107), KS_m,
  621. KC(108), KS_ugrave, KS_percent,
  622. KC(112), KS_comma, KS_question,
  623. KC(113), KS_semicolon, KS_period,
  624. KC(114), KS_colon, KS_slash,
  625. KC(115), KS_exclam, KS_section,
  626. KC(116), KS_asterisk, KS_mu,
  627. KC(118), KS_less, KS_greater,
  628. KS_guillemotleft,KS_guillemotright,
  629. KC(120), KS_n
  630. };
  631. #define KBD_MAP(name, base, map) \
  632. { name, base, sizeof(map)/sizeof(keysym_t), map }
  633. const struct wscons_keydesc hilkbd_keydesctab[] = {
  634. KBD_MAP(KB_US, 0, hilkbd_keydesc_us),
  635. KBD_MAP(KB_DE, KB_US, hilkbd_keydesc_de),
  636. KBD_MAP(KB_DE | KB_NODEAD, KB_DE, hilkbd_keydesc_de_nodead),
  637. KBD_MAP(KB_FR, KB_US, hilkbd_keydesc_fr),
  638. KBD_MAP(KB_UK, KB_US, hilkbd_keydesc_uk),
  639. KBD_MAP(KB_SV, KB_US, hilkbd_keydesc_sv),
  640. KBD_MAP(KB_SV | KB_NODEAD, KB_SV, hilkbd_keydesc_sv_nodead),
  641. {0, 0, 0, 0},
  642. };
  643. const struct wscons_keydesc hilkbd_keydesctab_ps2[] = {
  644. KBD_MAP(KB_US, 0, hilkbd_keydesc_us),
  645. KBD_MAP(KB_DE, KB_US, hilkbd_keydesc_de_ps2),
  646. KBD_MAP(KB_DE | KB_NODEAD, KB_DE, hilkbd_keydesc_de_ps2_nodead),
  647. KBD_MAP(KB_FR, KB_US, hilkbd_keydesc_fr_ps2),
  648. KBD_MAP(KB_UK, KB_US, hilkbd_keydesc_uk_ps2),
  649. KBD_MAP(KB_SV, KB_US, hilkbd_keydesc_sv_ps2),
  650. KBD_MAP(KB_SV | KB_NODEAD, KB_SV, hilkbd_keydesc_sv_ps2_nodead),
  651. {0, 0, 0, 0},
  652. };
  653. /*
  654. * Keyboard ID to layout table
  655. */
  656. const kbd_t hilkbd_layouts[MAXHILKBDLAYOUT] = {
  657. -1, /* 00 Undefined or custom layout */
  658. -1, /* 01 Undefined */
  659. -1, /* 02 Japanese */
  660. -1, /* 03 Swiss french */
  661. -1, /* 04 Portuguese */
  662. -1, /* 05 Arabic */
  663. -1, /* 06 Hebrew */
  664. -1, /* 07 Canadian English */
  665. -1, /* 08 Turkish */
  666. -1, /* 09 Greek */
  667. -1, /* 0a Thai */
  668. -1, /* 0b Italian */
  669. -1, /* 0c Korean */
  670. -1, /* 0d Dutch */
  671. KB_SV, /* 0e Swedish */
  672. KB_DE, /* 0f German */
  673. -1, /* 10 Simplified Chinese */
  674. -1, /* 11 Traditional Chinese */
  675. -1, /* 12 Swiss French 2 */
  676. -1, /* 13 Euro Spanish */
  677. -1, /* 14 Swiss German 2 */
  678. -1, /* 15 Belgian */
  679. -1, /* 16 Finnish */
  680. KB_UK, /* 17 UK English */
  681. -1, /* 18 Canadian French */
  682. -1, /* 19 Swiss German */
  683. -1, /* 1a Norwegian */
  684. KB_FR, /* 1b French */
  685. -1, /* 1c Danish */
  686. -1, /* 1d Katakana */
  687. -1, /* 1e Latin Spanish */
  688. KB_US, /* 1f US ASCII */
  689. };