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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. * Mic = F13(Adjustable keyboard)
  38. */
  39. // http://lxr.free-electrons.com/source/drivers/macintosh/adbhid.c
  40. // http://opensource.apple.com//source/IOHIDFamily/IOHIDFamily-701.20.10/IOHIDFamily/Cosmo_USB2ADB.c
  41. // http://m0115.web.fc2.com/m0115.jpg
  42. const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
  43. // Position(unimap) ADB scan code(matrix)
  44. // ---------------------------------------------
  45. {
  46. UNIMAP_A, // 0x00
  47. UNIMAP_S, // 0x01
  48. UNIMAP_D, // 0x02
  49. UNIMAP_F, // 0x03
  50. UNIMAP_H, // 0x04
  51. UNIMAP_G, // 0x05
  52. UNIMAP_Z, // 0x06
  53. UNIMAP_X, // 0x07
  54. },
  55. {
  56. UNIMAP_C, // 0x08
  57. UNIMAP_V, // 0x09
  58. UNIMAP_NONUS_BSLASH, // 0x0A
  59. UNIMAP_B, // 0x0B
  60. UNIMAP_Q, // 0x0C
  61. UNIMAP_W, // 0x0D
  62. UNIMAP_E, // 0x0E
  63. UNIMAP_R, // 0x0F
  64. },
  65. {
  66. UNIMAP_Y, // 0x10
  67. UNIMAP_T, // 0x11
  68. UNIMAP_1, // 0x12
  69. UNIMAP_2, // 0x13
  70. UNIMAP_3, // 0x14
  71. UNIMAP_4, // 0x15
  72. UNIMAP_6, // 0x16
  73. UNIMAP_5, // 0x17
  74. },
  75. {
  76. UNIMAP_EQUAL, // 0x18
  77. UNIMAP_9, // 0x19
  78. UNIMAP_7, // 0x1A
  79. UNIMAP_MINUS, // 0x1B
  80. UNIMAP_8, // 0x1C
  81. UNIMAP_0, // 0x1D
  82. UNIMAP_RBRACKET, // 0x1E
  83. UNIMAP_O, // 0x1F
  84. },
  85. {
  86. UNIMAP_U, // 0x20
  87. UNIMAP_LBRACKET, // 0x21
  88. UNIMAP_I, // 0x22
  89. UNIMAP_P, // 0x23
  90. UNIMAP_ENTER, // 0x24
  91. UNIMAP_L, // 0x25
  92. UNIMAP_J, // 0x26
  93. UNIMAP_QUOTE, // 0x27
  94. },
  95. {
  96. UNIMAP_K, // 0x28
  97. UNIMAP_SCOLON, // 0x29
  98. UNIMAP_BSLASH, // 0x2A
  99. UNIMAP_COMMA, // 0x2B
  100. UNIMAP_SLASH, // 0x2C
  101. UNIMAP_N, // 0x2D
  102. UNIMAP_M, // 0x2E
  103. UNIMAP_DOT, // 0x2F
  104. },
  105. {
  106. UNIMAP_TAB, // 0x30
  107. UNIMAP_SPACE, // 0x31
  108. UNIMAP_GRAVE, // 0x32
  109. UNIMAP_BSPACE, // 0x33
  110. UNIMAP_KP_ENTER, // 0x34
  111. UNIMAP_ESCAPE, // 0x35
  112. UNIMAP_LCTRL, // 0x36
  113. UNIMAP_LGUI, // 0x37
  114. },
  115. {
  116. UNIMAP_LSHIFT, // 0x38
  117. UNIMAP_CAPSLOCK, // 0x39
  118. UNIMAP_LALT, // 0x3A
  119. UNIMAP_LEFT, // 0x3B
  120. UNIMAP_RIGHT, // 0x3C
  121. UNIMAP_DOWN, // 0x3D
  122. UNIMAP_UP, // 0x3E
  123. UNIMAP_F23, // 0x3F FN?
  124. },
  125. {
  126. UNIMAP_F17, // 0x40
  127. UNIMAP_KP_DOT, // 0x41
  128. UNIMAP_F13, // 0x42 Mic(Adjustable keyboard)
  129. UNIMAP_KP_MINUS, // 0x43 ADB keypad asterisk(top right)
  130. UNIMAP_NO, // 0x44
  131. UNIMAP_KP_COMMA, // 0x45 ADB keypad plus
  132. UNIMAP_NO, // 0x46
  133. UNIMAP_NUMLOCK, // 0x47
  134. },
  135. {
  136. UNIMAP_VOLUME_UP, // 0x48 Vol Up(Adjustable keyboard)
  137. UNIMAP_VOLUME_DOWN, // 0x49 Vol Down(Adjustable keyboard)
  138. UNIMAP_VOLUME_MUTE, // 0x4A Vol Mute(Adjustable keyboard)
  139. UNIMAP_KP_ASTERISK, // 0x4B ADB keypad slash(between equal and asterisk)
  140. UNIMAP_KP_ENTER, // 0x4C
  141. UNIMAP_NO, // 0x4D
  142. UNIMAP_KP_PLUS, // 0x4E ADB keypad minus
  143. UNIMAP_F18, // 0x4F
  144. },
  145. {
  146. UNIMAP_F19, // 0x50
  147. UNIMAP_KP_SLASH, // 0x51 ADB keypad equal(next to clear/numlock)
  148. UNIMAP_KP_0, // 0x52
  149. UNIMAP_KP_1, // 0x53
  150. UNIMAP_KP_2, // 0x54
  151. UNIMAP_KP_3, // 0x55
  152. UNIMAP_KP_4, // 0x56
  153. UNIMAP_KP_5, // 0x57
  154. },
  155. {
  156. UNIMAP_KP_6, // 0x58
  157. UNIMAP_KP_7, // 0x59
  158. UNIMAP_F20, // 0x5A
  159. UNIMAP_KP_8, // 0x5B
  160. UNIMAP_KP_9, // 0x5C
  161. UNIMAP_JYEN, // 0x5D
  162. UNIMAP_RO, // 0x5E
  163. UNIMAP_KP_COMMA, // 0x5F
  164. },
  165. {
  166. UNIMAP_F5, // 0x60
  167. UNIMAP_F6, // 0x61
  168. UNIMAP_F7, // 0x62
  169. UNIMAP_F3, // 0x63
  170. UNIMAP_F8, // 0x64
  171. UNIMAP_F9, // 0x65
  172. UNIMAP_MHEN, // 0x66
  173. UNIMAP_F11, // 0x67
  174. },
  175. {
  176. UNIMAP_HENK, // 0x68
  177. UNIMAP_PSCREEN, // 0x69
  178. UNIMAP_F16, // 0x6A
  179. UNIMAP_SCROLLLOCK, // 0x6B
  180. UNIMAP_NO, // 0x6C
  181. UNIMAP_F10, // 0x6D
  182. UNIMAP_APPLICATION, // 0x6E compose
  183. UNIMAP_F12, // 0x6F
  184. },
  185. {
  186. UNIMAP_NO, // 0x70
  187. UNIMAP_PAUSE, // 0x71
  188. UNIMAP_INSERT, // 0x72
  189. UNIMAP_HOME, // 0x73
  190. UNIMAP_PGUP, // 0x74
  191. UNIMAP_DELETE, // 0x75
  192. UNIMAP_F4, // 0x76
  193. UNIMAP_END, // 0x77
  194. },
  195. {
  196. UNIMAP_F2, // 0x78
  197. UNIMAP_PGDOWN, // 0x79
  198. UNIMAP_F1, // 0x7A
  199. UNIMAP_RSHIFT, // 0x7B
  200. UNIMAP_RALT, // 0x7C
  201. UNIMAP_RCTRL, // 0x7D
  202. UNIMAP_RGUI, // 0x7E
  203. UNIMAP_F24, // 0x7F power key
  204. }
  205. };
  206. #endif