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 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. /* Mapping to Universal keyboard layout
  20. *
  21. * Universal keyboard layout
  22. * ,-----------------------------------------------.
  23. * |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
  24. * ,---. |-----------------------------------------------| ,-----------. ,-----------.
  25. * |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|
  26. * `---' `-----------------------------------------------' `-----------' `-----------'
  27. * ,-----------------------------------------------------------. ,-----------. ,---------------.
  28. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
  29. * |-----------------------------------------------------------| |-----------| |---------------|
  30. * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +|
  31. * |-----------------------------------------------------------| `-----------' |---------------|
  32. * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| | 4| 5| 6|KP,|
  33. * |-----------------------------------------------------------| ,---. |---------------|
  34. * |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|KP=|
  35. * |-----------------------------------------------------------| ,-----------. |---------------|
  36. * |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent|
  37. * `-----------------------------------------------------------' `-----------' `---------------'
  38. */
  39. #ifndef HHKB_JP
  40. /* HHKB
  41. * ,-----------------------------------------------------------.
  42. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|BS |
  43. * |-----------------------------------------------------------|
  44. * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |
  45. * |-----------------------------------------------------------|
  46. * |CapsL | A| S| D| F| G| H| J| K| L| ;| '|Enter |
  47. * |-----------------------------------------------------------|
  48. * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Ctl|
  49. * `-----------------------------------------------------------'
  50. * |Gui|Alt | Space |Alt |Gui|
  51. * `-------------------------------------------'
  52. *
  53. * Matrix - row:8 x col:8
  54. * ,-----------------------------------------------------------.
  55. * |31 |30 |00 |10 |11 |20 |21 |40 |41 |60 |61 |70 |71 |50 |51 |
  56. * |-----------------------------------------------------------|
  57. * |32 |01 |02 |13 |12 |23 |22 |42 |43 |62 |63 |73 |72 |52 |
  58. * |-----------------------------------------------------------|
  59. * |33 |04 |03 |14 |15 |24 |25 |45 |44 |65 |64 |74 | 53 |
  60. * |-----------------------------------------------------------|
  61. * |34 |05 |06 |07 |16 |17 |26 |46 |66 |76 |75 |55 |54 |
  62. * `-----------------------------------------------------------'
  63. * |35 |36 | 37 |57 |56 |
  64. * `-------------------------------------------'
  65. */
  66. const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
  67. { UNIMAP_2, UNIMAP_Q, UNIMAP_W, UNIMAP_S, UNIMAP_A, UNIMAP_Z, UNIMAP_X, UNIMAP_C, },
  68. { UNIMAP_3, UNIMAP_4, UNIMAP_R, UNIMAP_E, UNIMAP_D, UNIMAP_F, UNIMAP_V, UNIMAP_B, },
  69. { UNIMAP_5, UNIMAP_6, UNIMAP_Y, UNIMAP_T, UNIMAP_G, UNIMAP_H, UNIMAP_N, UNIMAP_NO, },
  70. { UNIMAP_1, UNIMAP_GRAVE, UNIMAP_TAB, UNIMAP_CAPSLOCK, UNIMAP_LSHIFT, UNIMAP_LGUI, UNIMAP_LALT, UNIMAP_SPACE, },
  71. { UNIMAP_7, UNIMAP_8, UNIMAP_U, UNIMAP_I, UNIMAP_K, UNIMAP_J, UNIMAP_M, UNIMAP_NO, },
  72. { UNIMAP_JYEN, UNIMAP_BSPACE, UNIMAP_BSLASH, UNIMAP_ENTER, UNIMAP_RCTRL, UNIMAP_RSHIFT, UNIMAP_RGUI, UNIMAP_RALT, },
  73. { UNIMAP_9, UNIMAP_0, UNIMAP_O, UNIMAP_P, UNIMAP_SCOLON, UNIMAP_L, UNIMAP_COMMA, UNIMAP_NO, },
  74. { UNIMAP_MINUS, UNIMAP_EQUAL, UNIMAP_RBRACKET, UNIMAP_LBRACKET, UNIMAP_QUOTE, UNIMAP_SLASH, UNIMAP_DOT, UNIMAP_NO, },
  75. };
  76. #else
  77. /* HHKB JP
  78. * ,-----------------------------------------------------------.
  79. * |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |JPY|BS |
  80. * |-----------------------------------------------------------|
  81. * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] | |
  82. * |------------------------------------------------------` |
  83. * |CapsL |A |S |D |F |G |H |J |K |L |; |' |# |Entr|
  84. * |-----------------------------------------------------------|
  85. * |Shift |Z |X |C |V |B |N |M |, |. |/ |RO |Up |Shi|
  86. * |-----------------------------------------------------------|
  87. * |Ctl||Esc|Gui|Alt|MHE| |HEN|KAN|Alt|Ctl||Lef|Dow|Rig|
  88. * `-----------------------------------------------------------'
  89. *
  90. * Matrix - row:16 x col:8
  91. * ,-----------------------------------------------------------.
  92. * |02 |32 |62 |22 |12 |52 |72 |A2 |92 |82 |B2 |E2 |F2 |D2 |C2 |
  93. * |-----------------------------------------------------------|
  94. * |03 |63 |23 |13 |53 |73 |A3 |93 |83 |B3 |E3 |F3 |D3 | |
  95. * |------------------------------------------------------` |
  96. * |06 |66 |26 |16 |56 |76 |A6 |96 |86 |B6 |E6 |F6 |D6 | C6 |
  97. * |-----------------------------------------------------------|
  98. * |05 |65 |25 |15 |55 |75 |A5 |95 |85 |B5 |E5 |F5 |D5 |C5 |
  99. * |-----------------------------------------------------------|
  100. * |04 ||34 |64 |24 |14 | 74 |94 |84 |B4 |E4 ||F4 |D4 |C4 |
  101. * `-----------------------------------------------------------'
  102. */
  103. const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
  104. { UNIMAP_NO, UNIMAP_NO, UNIMAP_GRAVE, UNIMAP_TAB, UNIMAP_LCTRL, UNIMAP_LSHIFT, UNIMAP_CAPSLOCK, UNIMAP_NO, },
  105. { UNIMAP_NO, UNIMAP_NO, UNIMAP_4, UNIMAP_E, UNIMAP_MHEN, UNIMAP_C, UNIMAP_D, UNIMAP_NO, },
  106. { UNIMAP_NO, UNIMAP_NO, UNIMAP_3, UNIMAP_W, UNIMAP_LALT, UNIMAP_X, UNIMAP_S, UNIMAP_NO, },
  107. { UNIMAP_NO, UNIMAP_NO, UNIMAP_1, UNIMAP_NO, UNIMAP_ESCAPE, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, },
  108. { UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, },
  109. { UNIMAP_NO, UNIMAP_NO, UNIMAP_5, UNIMAP_R, UNIMAP_NO, UNIMAP_V, UNIMAP_F, UNIMAP_NO, },
  110. { UNIMAP_NO, UNIMAP_NO, UNIMAP_2, UNIMAP_Q, UNIMAP_LGUI, UNIMAP_Z, UNIMAP_A, UNIMAP_NO, },
  111. { UNIMAP_NO, UNIMAP_NO, UNIMAP_6, UNIMAP_T, UNIMAP_SPACE, UNIMAP_B, UNIMAP_G, UNIMAP_NO, },
  112. { UNIMAP_NO, UNIMAP_NO, UNIMAP_9, UNIMAP_I, UNIMAP_KANA, UNIMAP_COMMA, UNIMAP_K, UNIMAP_NO, },
  113. { UNIMAP_NO, UNIMAP_NO, UNIMAP_8, UNIMAP_U, UNIMAP_HENK, UNIMAP_M, UNIMAP_J, UNIMAP_NO, },
  114. { UNIMAP_NO, UNIMAP_NO, UNIMAP_7, UNIMAP_Y, UNIMAP_NO, UNIMAP_N, UNIMAP_H, UNIMAP_NO, },
  115. { UNIMAP_NO, UNIMAP_NO, UNIMAP_0, UNIMAP_O, UNIMAP_RALT, UNIMAP_DOT, UNIMAP_L, UNIMAP_NO, },
  116. { UNIMAP_NO, UNIMAP_NO, UNIMAP_BSPACE, UNIMAP_NO, UNIMAP_RIGHT, UNIMAP_RSHIFT, UNIMAP_ENTER, UNIMAP_NO, },
  117. { UNIMAP_NO, UNIMAP_NO, UNIMAP_JYEN, UNIMAP_RBRACKET, UNIMAP_DOWN, UNIMAP_UP, UNIMAP_NONUS_HASH, UNIMAP_NO, },
  118. { UNIMAP_NO, UNIMAP_NO, UNIMAP_MINUS, UNIMAP_P, UNIMAP_RCTRL, UNIMAP_SLASH, UNIMAP_SCOLON, UNIMAP_NO, },
  119. { UNIMAP_NO, UNIMAP_NO, UNIMAP_EQUAL, UNIMAP_LBRACKET, UNIMAP_LEFT, UNIMAP_RO, UNIMAP_QUOTE, UNIMAP_NO, },
  120. };
  121. #endif
  122. #endif