Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

unimap_trans.h 9.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. /*
  2. Copyright 2016 Jun Wako <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef UNIMAP_COMMON_H
  15. #define UNIMAP_COMMON_H
  16. #include <stdint.h>
  17. #include <avr/pgmspace.h>
  18. #include "unimap.h"
  19. /* M0110A scan codes
  20. * ,---------------------------------------------------------. ,---------------.
  21. * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
  22. * |---------------------------------------------------------| |---------------|
  23. * | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E|
  24. * |-----------------------------------------------------' | |---------------|
  25. * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
  26. * |---------------------------------------------------------| |---------------|
  27. * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| 4D| | 53| 54| 55| |
  28. * `---------------------------------------------------------' |-----------| 4C|
  29. * | 3A| 37| 31 | 2A| 46| 42| 48| | 52| 41| |
  30. * `---------------------------------------------------------' `---------------'
  31. *
  32. * M0110 + M0120 scan codes
  33. * ,---------------------------------------------------------. ,---------------.
  34. * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
  35. * |---------------------------------------------------------| |---------------|
  36. * | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
  37. * |---------------------------------------------------------| |---------------|
  38. * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
  39. * |---------------------------------------------------------| |---------------|
  40. * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| | 53| 54| 55| |
  41. * `---------------------------------------------------------' |-----------| 4C|
  42. * | 3A| 37| 31 | 34| 3A| | 52| 41| |
  43. * `------------------------------------------------' `---------------'
  44. *
  45. * International M0110
  46. * https://en.wikipedia.org/wiki/File:Apple_Macintosh_Plus_Keyboard.jpg
  47. * Probably International keyboard layout of M0110A doesn't exist.
  48. * ,---------------------------------------------------------.
  49. * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33|
  50. * |---------------------------------------------------------|
  51. * | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A|
  52. * |------------------------------------------------------, |
  53. * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| |
  54. * |---------------------------------------------------------|
  55. * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A| 38|
  56. * `---------------------------------------------------------'
  57. * | 3A| 37| 34 | 31| 3A|
  58. * `------------------------------------------------'
  59. */
  60. const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
  61. // Position(unimap) scan code(matrix)
  62. // ---------------------------------------------
  63. {
  64. UNIMAP_A, // 0x00
  65. UNIMAP_S, // 0x01
  66. UNIMAP_D, // 0x02
  67. UNIMAP_F, // 0x03
  68. UNIMAP_H, // 0x04
  69. UNIMAP_G, // 0x05
  70. #ifdef M0110_INTL
  71. UNIMAP_NONUS_BSLASH, // 0x06
  72. UNIMAP_Z, // 0x07
  73. },
  74. {
  75. UNIMAP_X, // 0x08
  76. UNIMAP_C, // 0x09
  77. UNIMAP_SLASH, // 0x0A
  78. UNIMAP_V, // 0x0B
  79. #else
  80. UNIMAP_Z, // 0x06
  81. UNIMAP_X, // 0x07
  82. },
  83. {
  84. UNIMAP_C, // 0x08
  85. UNIMAP_V, // 0x09
  86. UNIMAP_NO, // 0x0A
  87. UNIMAP_B, // 0x0B
  88. #endif
  89. UNIMAP_Q, // 0x0C
  90. UNIMAP_W, // 0x0D
  91. UNIMAP_E, // 0x0E
  92. UNIMAP_R, // 0x0F
  93. },
  94. {
  95. UNIMAP_Y, // 0x10
  96. UNIMAP_T, // 0x11
  97. UNIMAP_1, // 0x12
  98. UNIMAP_2, // 0x13
  99. UNIMAP_3, // 0x14
  100. UNIMAP_4, // 0x15
  101. UNIMAP_6, // 0x16
  102. UNIMAP_5, // 0x17
  103. },
  104. {
  105. UNIMAP_EQUAL, // 0x18
  106. UNIMAP_9, // 0x19
  107. UNIMAP_7, // 0x1A
  108. UNIMAP_MINUS, // 0x1B
  109. UNIMAP_8, // 0x1C
  110. UNIMAP_0, // 0x1D
  111. UNIMAP_RBRACKET, // 0x1E
  112. UNIMAP_O, // 0x1F
  113. },
  114. {
  115. UNIMAP_U, // 0x20
  116. UNIMAP_LBRACKET, // 0x21
  117. UNIMAP_I, // 0x22
  118. UNIMAP_P, // 0x23
  119. #ifdef M0110_INTL
  120. UNIMAP_NONUS_HASH, // 0x24
  121. #else
  122. UNIMAP_ENTER, // 0x24
  123. #endif
  124. UNIMAP_L, // 0x25
  125. UNIMAP_J, // 0x26
  126. UNIMAP_QUOTE, // 0x27
  127. },
  128. {
  129. UNIMAP_K, // 0x28
  130. UNIMAP_SCOLON, // 0x29
  131. #ifdef M0110_INTL
  132. UNIMAP_ENTER, // 0x2A
  133. UNIMAP_M, // 0x2B
  134. UNIMAP_DOT, // 0x2C
  135. UNIMAP_B, // 0x2D
  136. UNIMAP_N, // 0x2E
  137. UNIMAP_COMMA, // 0x2F
  138. #else
  139. UNIMAP_BSLASH, // 0x2A
  140. UNIMAP_COMMA, // 0x2B
  141. UNIMAP_SLASH, // 0x2C
  142. UNIMAP_N, // 0x2D
  143. UNIMAP_M, // 0x2E
  144. UNIMAP_DOT, // 0x2F
  145. #endif
  146. },
  147. {
  148. UNIMAP_TAB, // 0x30
  149. #ifdef M0110_INTL
  150. UNIMAP_RGUI, // 0x31
  151. #else
  152. UNIMAP_SPACE, // 0x31
  153. #endif
  154. UNIMAP_GRAVE, // 0x32
  155. UNIMAP_BSPACE, // 0x33
  156. #ifdef M0110_INTL
  157. UNIMAP_SPACE, // 0x34
  158. #else
  159. UNIMAP_RGUI, // 0x34
  160. #endif
  161. UNIMAP_NO, // 0x35
  162. UNIMAP_NO, // 0x36
  163. UNIMAP_LGUI, // 0x37
  164. },
  165. {
  166. UNIMAP_LSHIFT, // 0x38
  167. UNIMAP_CAPSLOCK, // 0x39
  168. UNIMAP_LALT, // 0x3A
  169. UNIMAP_NO, // 0x3B
  170. UNIMAP_NO, // 0x3C
  171. UNIMAP_NO, // 0x3D
  172. UNIMAP_NO, // 0x3E
  173. UNIMAP_NO, // 0x3F
  174. },
  175. {
  176. UNIMAP_NO, // 0x40
  177. UNIMAP_KP_DOT, // 0x41
  178. UNIMAP_RIGHT, // 0x42
  179. UNIMAP_NO, // 0x43
  180. UNIMAP_NO, // 0x44
  181. UNIMAP_NO, // 0x45
  182. UNIMAP_LEFT, // 0x46
  183. UNIMAP_NUMLOCK, // 0x47
  184. },
  185. {
  186. UNIMAP_DOWN, // 0x48
  187. UNIMAP_NO, // 0x49
  188. UNIMAP_NO, // 0x4A
  189. UNIMAP_NO, // 0x4B
  190. UNIMAP_KP_ENTER, // 0x4C
  191. UNIMAP_UP, // 0x4D
  192. UNIMAP_KP_PLUS, // 0x4E keypad minus
  193. UNIMAP_NO, // 0x4F
  194. },
  195. {
  196. UNIMAP_NO, // 0x50
  197. UNIMAP_NO, // 0x51
  198. UNIMAP_KP_0, // 0x52
  199. UNIMAP_KP_1, // 0x53
  200. UNIMAP_KP_2, // 0x54
  201. UNIMAP_KP_3, // 0x55
  202. UNIMAP_KP_4, // 0x56
  203. UNIMAP_KP_5, // 0x57
  204. },
  205. {
  206. UNIMAP_KP_6, // 0x58
  207. UNIMAP_KP_7, // 0x59
  208. UNIMAP_NO, // 0x5A
  209. UNIMAP_KP_8, // 0x5B
  210. UNIMAP_KP_9, // 0x5C
  211. UNIMAP_NO, // 0x5D
  212. UNIMAP_NO, // 0x5E
  213. UNIMAP_NO, // 0x5F
  214. },
  215. {
  216. UNIMAP_NO, // 0x60
  217. UNIMAP_NO, // 0x61
  218. UNIMAP_KP_MINUS, // 0x62 keypad asterisk
  219. UNIMAP_NO, // 0x63
  220. UNIMAP_NO, // 0x64
  221. UNIMAP_NO, // 0x65
  222. UNIMAP_KP_COMMA, // 0x66
  223. UNIMAP_NO, // 0x67
  224. },
  225. {
  226. UNIMAP_KP_SLASH, // 0x68 keypad equal
  227. UNIMAP_NO, // 0x69
  228. UNIMAP_NO, // 0x6A
  229. UNIMAP_NO, // 0x6B
  230. UNIMAP_NO, // 0x6C
  231. UNIMAP_KP_ASTERISK, // 0x6D keypad slash
  232. UNIMAP_NO, // 0x6E compose
  233. UNIMAP_NO, // 0x6F
  234. },
  235. };
  236. #endif