lk201-remap.c 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * Keyboard mappings for DEC LK201/401/501 keyboards
  3. *
  4. * 17.05.99 Michael Engel (engel@unix-ag.org)
  5. *
  6. * DEC US keyboards generate keycodes in the range 0x55 - 0xfb
  7. *
  8. * This conflicts with Linux scancode conventions which define
  9. * 0x00-0x7f as "normal" and 0x80-0xff as "shifted" scancodes, so we
  10. * have to remap the keycodes to 0x00-0x7f with the scancodeRemap
  11. * array. The generated scancode is simply the number of the key counted
  12. * from the left upper to the right lower corner of the keyboard ...
  13. *
  14. * These scancodes are then being remapped (I hope ;-)) with the
  15. * lk501*map[] arrays which define scancode -> Linux code mapping
  16. *
  17. * Oh man is this horrible ;-)
  18. *
  19. * Scancodes with dual labels exist for keyboards as follows:
  20. *
  21. * code: left label / right label
  22. *
  23. * 0x73: LKx01, LK421 / LK443, LK444
  24. * 0x74: LKx01, LK421 / LK443, LK444
  25. * 0x7c: LKx01, LK421 / LK443, LK444
  26. * 0x8a: LKx01, LK421 / LK443, LK444
  27. * 0x8b: LKx01, LK421 / LK443, LK444
  28. * 0x8c: LKx01, LK421 / LK443, LK444
  29. * 0x8d: LKx01, LK421 / LK443, LK444
  30. * 0x8e: LKx01, LK421 / LK443, LK444
  31. * 0x8f: LKx01, LK421 / LK443, LK444
  32. * 0x9c: LKx01, LK421 / LK443, LK444
  33. * 0xa1: LKx01, LK421 / LK443, LK444
  34. * 0xa2: LKx01, LK421 / LK443, LK444
  35. * 0xa3: LKx01, LK421 / LK443, LK444
  36. * 0xa4: LKx01, LK421 / LK443, LK444
  37. * 0xad: LK421 / LK443, LK444
  38. * 0xc9: LKx01, LK421, LK443 / LK444
  39. * 0xf7: LKx01, LK443 / LK444
  40. */
  41. unsigned char scancodeRemap[256] = {
  42. /* ----- */
  43. /* 0 */ 0, 0, 0, 0,
  44. /* ----- */
  45. /* 4 */ 0, 0, 0, 0,
  46. /* ----- */
  47. /* 8 */ 0, 0, 0, 0,
  48. /* ----- */
  49. /* c */ 0, 0, 0, 0,
  50. /* ----- */
  51. /* 10 */ 0, 0, 0, 0,
  52. /* ----- */
  53. /* 14 */ 0, 0, 0, 0,
  54. /* ----- */
  55. /* 18 */ 0, 0, 0, 0,
  56. /* ----- */
  57. /* 1c */ 0, 0, 0, 0,
  58. /* ----- */
  59. /* 20 */ 0, 0, 0, 0,
  60. /* ----- */
  61. /* 24 */ 0, 0, 0, 0,
  62. /* ----- */
  63. /* 28 */ 0, 0, 0, 0,
  64. /* ----- */
  65. /* 2c */ 0, 0, 0, 0,
  66. /* ----- */
  67. /* 30 */ 0, 0, 0, 0,
  68. /* ----- */
  69. /* 34 */ 0, 0, 0, 0,
  70. /* ----- */
  71. /* 38 */ 0, 0, 0, 0,
  72. /* ----- */
  73. /* 3c */ 0, 0, 0, 0,
  74. /* ----- */
  75. /* 40 */ 0, 0, 0, 0,
  76. /* ----- */
  77. /* 44 */ 0, 0, 0, 0,
  78. /* ----- */
  79. /* 48 */ 0, 0, 0, 0,
  80. /* ----- */
  81. /* 4c */ 0, 0, 0, 0,
  82. /* ----- */
  83. /* 50 */ 0, 0, 0, 0,
  84. /* ----- ESC F1 F2 */
  85. /* 54 */ 0, 0, 0x01, 0x02,
  86. /* ----- F3 F4 F5 */
  87. /* 58 */ 0x03, 0x04, 0x05, 0,
  88. /* ----- */
  89. /* 5c */ 0, 0, 0, 0,
  90. /* ----- */
  91. /* 60 */ 0, 0, 0, 0,
  92. /* ----- F6 F7 F8 F9 */
  93. /* 64 */ 0x06, 0x07, 0x08, 0x09,
  94. /* ----- F10 */
  95. /* 68 */ 0x0a, 0, 0, 0,
  96. /* ----- */
  97. /* 6c */ 0, 0, 0, 0,
  98. /* ----- F11 F12 F13/PRNT SCRN */
  99. /* 70 */ 0, 0x0b, 0x0c, 0x0d,
  100. /* ----- F14/SCRL LCK */
  101. /* 74 */ 0x0e, 0, 0, 0,
  102. /* ----- */
  103. /* 78 */ 0, 0, 0, 0,
  104. /* ----- HELP/PAUSE DO */
  105. /* 7c */ 0x0f, 0x10, 0, 0,
  106. /* ----- F17 F18 F19 F20 */
  107. /* 80 */ 0x11, 0x12, 0x13, 0x14,
  108. /* ----- */
  109. /* 84 */ 0, 0, 0, 0,
  110. /* ----- FIND/INSERT INSERT/HOME */
  111. /* 88 */ 0, 0, 0x23, 0x24,
  112. /* ----- REMOVE/PG UP SELECT/DELETE PREVIOUS/END NEXT/PG DN */
  113. /* 8c */ 0x25, 0x38, 0x39, 0x3a,
  114. /* ----- KP 0 */
  115. /* 90 */ 0, 0, 0x6b, 0,
  116. /* ----- KP . KP ENTER KP 1 KP 2 */
  117. /* 94 */ 0x6c, 0x65, 0x62, 0x63,
  118. /* ----- KP 3 KP 4 KP 5 KP 6 */
  119. /* 98 */ 0x64, 0x4e, 0x4f, 0x50,
  120. /* ----- KP ,/KP + KP 7 KP 8 KP 9 */
  121. /* 9c */ 0x51, 0x3b, 0x3c, 0x3d,
  122. /* ----- KP - KP F1/NUM LCK KP F2/KP / KP F3/KP * */
  123. /* a0 */ 0x3e, 0x26, 0x27, 0x28,
  124. /* ----- KP F4/KP - LEFT */
  125. /* a4 */ 0x29, 0, 0, 0x5f,
  126. /* ----- RIGHT DOWN UP SHIFT Rt */
  127. /* a8 */ 0x61, 0x60, 0x4d, 0x5e,
  128. /* ----- ALT COMP Rt/CTRL Rt SHIFT CONTROL */
  129. /* ac */ 0, 0, 0x52, 0x3f,
  130. /* ----- CAPS COMPOSE ALT Rt */
  131. /* b0 */ 0x40, 0x67, 0, 0,
  132. /* ----- */
  133. /* b4 */ 0, 0, 0, 0,
  134. /* ----- */
  135. /* b8 */ 0, 0, 0, 0,
  136. /* ----- BKSP RET TAB ` */
  137. /* bc */ 0x22, 0x37, 0x2a, 0x15,
  138. /* ----- 1 q a z */
  139. /* c0 */ 0x16, 0x2b, 0x41, 0x54,
  140. /* ----- 2 w s */
  141. /* c4 */ 0, 0x17, 0x2c, 0x42,
  142. /* ----- x </\\ 3 */
  143. /* c8 */ 0x55, 0x53, 0, 0x18,
  144. /* ----- e d c */
  145. /* cc */ 0x2d, 0x43, 0x56, 0,
  146. /* ----- 4 r f v */
  147. /* d0 */ 0x19, 0x2e, 0x44, 0x57,
  148. /* ----- SPACE 5 t */
  149. /* d4 */ 0x68, 0, 0x1a, 0x2f,
  150. /* ----- g b 6 */
  151. /* d8 */ 0x45, 0x58, 0, 0x1b,
  152. /* ----- y h n */
  153. /* dc */ 0x30, 0x46, 0x59, 0,
  154. /* ----- 7 u j m */
  155. /* e0 */ 0x1c, 0x31, 0x47, 0x5a,
  156. /* ----- 8 i k */
  157. /* e4 */ 0, 0x1d, 0x32, 0x48,
  158. /* ----- , 9 o */
  159. /* e8 */ 0x5b, 0, 0x1e, 0x33,
  160. /* ----- l . 0 */
  161. /* ec */ 0x49, 0x5c, 0, 0x1f,
  162. /* ----- p ; / */
  163. /* f0 */ 0x34, 0, 0x4a, 0x5d,
  164. /* ----- = ] \\/\' */
  165. /* f4 */ 0, 0x21, 0x36, 0x4c,
  166. /* ----- - [ \' */
  167. /* f8 */ 0, 0x20, 0x35, 0x4b,
  168. /* ----- */
  169. /* fc */ 0, 0, 0, 0,
  170. };