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_common.h 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. /* Apple Extended Keyboard Common layout: ANSI+ISO
  20. * ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---------------.
  21. * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|F24|
  22. * `---' `---------------' `---------------' `---------------' `-----------' `---------------'
  23. * ,-----------------------------------------------------------. ,-----------. ,---------------.
  24. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *|
  25. * |-----------------------------------------------------------| |-----------| |---------------|
  26. * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| -|
  27. * |-----------------------------------------------------------| `-----------' |---------------|
  28. * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| +|
  29. * |-----------------------------------------------------------| ,---. |---------------|
  30. * |Shif|\ | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
  31. * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
  32. * |Ctrl |Alt |Gui | Space |Gui |Alt |Ctrl | |Lef|Dow|Rig| | 0| .| |
  33. * `-----------------------------------------------------------' `-----------' `---------------'
  34. * Command = Gui
  35. * Option = Alt
  36. * Power key = F24
  37. */
  38. // http://lxr.free-electrons.com/source/drivers/macintosh/adbhid.c
  39. // http://opensource.apple.com//source/IOHIDFamily/IOHIDFamily-701.20.10/IOHIDFamily/Cosmo_USB2ADB.c
  40. // http://m0115.web.fc2.com/m0115.jpg
  41. const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
  42. // Position(unimap) ADB scan code(matrix)
  43. // ---------------------------------------------
  44. {
  45. UNIMAP_A, // 0x00
  46. UNIMAP_S, // 0x01
  47. UNIMAP_D, // 0x02
  48. UNIMAP_F, // 0x03
  49. UNIMAP_H, // 0x04
  50. UNIMAP_G, // 0x05
  51. UNIMAP_Z, // 0x06
  52. UNIMAP_X, // 0x07
  53. },
  54. {
  55. UNIMAP_C, // 0x08
  56. UNIMAP_V, // 0x09
  57. UNIMAP_NONUS_BSLASH, // 0x0A
  58. UNIMAP_B, // 0x0B
  59. UNIMAP_Q, // 0x0C
  60. UNIMAP_W, // 0x0D
  61. UNIMAP_E, // 0x0E
  62. UNIMAP_R, // 0x0F
  63. },
  64. {
  65. UNIMAP_Y, // 0x10
  66. UNIMAP_T, // 0x11
  67. UNIMAP_1, // 0x12
  68. UNIMAP_2, // 0x13
  69. UNIMAP_3, // 0x14
  70. UNIMAP_4, // 0x15
  71. UNIMAP_6, // 0x16
  72. UNIMAP_5, // 0x17
  73. },
  74. {
  75. UNIMAP_EQUAL, // 0x18
  76. UNIMAP_9, // 0x19
  77. UNIMAP_7, // 0x1A
  78. UNIMAP_MINUS, // 0x1B
  79. UNIMAP_8, // 0x1C
  80. UNIMAP_0, // 0x1D
  81. UNIMAP_RBRACKET, // 0x1E
  82. UNIMAP_O, // 0x1F
  83. },
  84. {
  85. UNIMAP_U, // 0x20
  86. UNIMAP_LBRACKET, // 0x21
  87. UNIMAP_I, // 0x22
  88. UNIMAP_P, // 0x23
  89. UNIMAP_ENTER, // 0x24
  90. UNIMAP_L, // 0x25
  91. UNIMAP_J, // 0x26
  92. UNIMAP_QUOTE, // 0x27
  93. },
  94. {
  95. UNIMAP_K, // 0x28
  96. UNIMAP_SCOLON, // 0x29
  97. UNIMAP_BSLASH, // 0x2A
  98. UNIMAP_COMMA, // 0x2B
  99. UNIMAP_SLASH, // 0x2C
  100. UNIMAP_N, // 0x2D
  101. UNIMAP_M, // 0x2E
  102. UNIMAP_DOT, // 0x2F
  103. },
  104. {
  105. UNIMAP_TAB, // 0x30
  106. UNIMAP_SPACE, // 0x31
  107. UNIMAP_GRAVE, // 0x32
  108. UNIMAP_BSPACE, // 0x33
  109. UNIMAP_KP_ENTER, // 0x34
  110. UNIMAP_ESCAPE, // 0x35
  111. UNIMAP_LCTRL, // 0x36
  112. UNIMAP_LGUI, // 0x37
  113. },
  114. {
  115. UNIMAP_LSHIFT, // 0x38
  116. UNIMAP_CAPSLOCK, // 0x39
  117. UNIMAP_LALT, // 0x3A
  118. UNIMAP_LEFT, // 0x3B
  119. UNIMAP_RIGHT, // 0x3C
  120. UNIMAP_DOWN, // 0x3D
  121. UNIMAP_UP, // 0x3E
  122. UNIMAP_F23, // 0x3F FN?
  123. },
  124. {
  125. UNIMAP_F17, // 0x40
  126. UNIMAP_KP_DOT, // 0x41
  127. UNIMAP_NO, // 0x42
  128. UNIMAP_KP_ASTERISK, // 0x43
  129. UNIMAP_NO, // 0x44
  130. UNIMAP_KP_PLUS, // 0x45
  131. UNIMAP_NO, // 0x46
  132. UNIMAP_NUMLOCK, // 0x47
  133. },
  134. {
  135. UNIMAP_NO, // 0x48
  136. UNIMAP_NO, // 0x49
  137. UNIMAP_NO, // 0x4A
  138. UNIMAP_KP_SLASH, // 0x4B
  139. UNIMAP_KP_ENTER, // 0x4C
  140. UNIMAP_NO, // 0x4D
  141. UNIMAP_KP_MINUS, // 0x4E
  142. UNIMAP_F18, // 0x4F
  143. },
  144. {
  145. UNIMAP_F19, // 0x50
  146. UNIMAP_KP_EQUAL, // 0x51
  147. UNIMAP_KP_0, // 0x52
  148. UNIMAP_KP_1, // 0x53
  149. UNIMAP_KP_2, // 0x54
  150. UNIMAP_KP_3, // 0x55
  151. UNIMAP_KP_4, // 0x56
  152. UNIMAP_KP_5, // 0x57
  153. },
  154. {
  155. UNIMAP_KP_6, // 0x58
  156. UNIMAP_KP_7, // 0x59
  157. UNIMAP_F20, // 0x5A
  158. UNIMAP_KP_8, // 0x5B
  159. UNIMAP_KP_9, // 0x5C
  160. UNIMAP_JYEN, // 0x5D
  161. UNIMAP_RO, // 0x5E
  162. UNIMAP_KP_COMMA, // 0x5F
  163. },
  164. {
  165. UNIMAP_F5, // 0x60
  166. UNIMAP_F6, // 0x61
  167. UNIMAP_F7, // 0x62
  168. UNIMAP_F3, // 0x63
  169. UNIMAP_F8, // 0x64
  170. UNIMAP_F9, // 0x65
  171. UNIMAP_MHEN, // 0x66
  172. UNIMAP_F11, // 0x67
  173. },
  174. {
  175. UNIMAP_HENK, // 0x68
  176. UNIMAP_PSCREEN, // 0x69
  177. UNIMAP_F16, // 0x6A
  178. UNIMAP_SCROLLLOCK, // 0x6B
  179. UNIMAP_NO, // 0x6C
  180. UNIMAP_F10, // 0x6D
  181. UNIMAP_APPLICATION, // 0x6E compose
  182. UNIMAP_F12, // 0x6F
  183. },
  184. {
  185. UNIMAP_NO, // 0x70
  186. UNIMAP_PAUSE, // 0x71
  187. UNIMAP_INSERT, // 0x72
  188. UNIMAP_HOME, // 0x73
  189. UNIMAP_PGUP, // 0x74
  190. UNIMAP_DELETE, // 0x75
  191. UNIMAP_F4, // 0x76
  192. UNIMAP_END, // 0x77
  193. },
  194. {
  195. UNIMAP_F2, // 0x78
  196. UNIMAP_PGDOWN, // 0x79
  197. UNIMAP_F1, // 0x7A
  198. UNIMAP_RSHIFT, // 0x7B
  199. UNIMAP_RALT, // 0x7C
  200. UNIMAP_RCTRL, // 0x7D
  201. UNIMAP_RGUI, // 0x7E
  202. UNIMAP_F24, // 0x7F power key
  203. }
  204. };
  205. #endif