keymap.c 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /* -*- eval: (turn-on-orgtbl); -*-
  2. * cinaeco's HHKB Layout
  3. */
  4. #include "hhkb.h"
  5. // Layers.
  6. #define QWER 0
  7. #define COLE 1
  8. #define DVOR 2
  9. #define HHKB 3
  10. #define UTIL 4
  11. #define MREC 5
  12. // Easier-to-read Layer Arrays.
  13. #define ____ KC_TRNS
  14. enum hhkb_keycodes {
  15. DYNAMIC_MACRO_RANGE = SAFE_RANGE,
  16. };
  17. #include "dynamic_macro.h"
  18. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  19. /* QWER Layer: Qwerty Default
  20. *
  21. * ,--------------------------------------------------------------.
  22. * |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
  23. * |--------------------------------------------------------------|
  24. * |Tab |Q/MREC| W| E| R| T| Y| U| I| O| P| [| ]|Backs|
  25. * |--------------------------------------------------------------|
  26. * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ent/Ctrl|
  27. * |--------------------------------------------------------------|
  28. * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0|
  29. * `--------------------------------------------------------------'
  30. * |Alt|Gui | Space/UTIL |Gui |Alt|
  31. * `-------------------------------------------'
  32. *
  33. */
  34. [QWER] = KEYMAP(
  35. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
  36. KC_TAB, LT(MREC, KC_Q), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
  37. KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, CTL_T(KC_ENT), \
  38. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), \
  39. KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
  40. /* COLE Layer: Colemak
  41. *
  42. * ,--------------------------------------------------------------.
  43. * |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
  44. * |--------------------------------------------------------------|
  45. * |Tab |Q/MREC| W| F| P| G| J| L| U| Y| ;| [| ]|Backs|
  46. * |--------------------------------------------------------------|
  47. * |Ctrl | A| R| S| T| D| H| N| E| I| O| '|Ent/Ctrl|
  48. * |--------------------------------------------------------------|
  49. * |Shift | Z| X| C| V| K| B| M| ,| .| /|Shift |Fn0|
  50. * `--------------------------------------------------------------'
  51. * |Alt|Gui | Space/UTIL |Gui |Alt|
  52. * `-------------------------------------------'
  53. *
  54. */
  55. [COLE] = KEYMAP(
  56. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
  57. KC_TAB, LT(MREC, KC_Q), KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, \
  58. KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, CTL_T(KC_ENT), \
  59. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_K, KC_B, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), \
  60. KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
  61. /* DVOR Layer: Dvorak
  62. *
  63. * ,--------------------------------------------------------------.
  64. * |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| `|
  65. * |--------------------------------------------------------------|
  66. * |Tab |'/MREC| ,| .| P| Y| F| G| C| R| L| /| =|Backs|
  67. * |--------------------------------------------------------------|
  68. * |Ctrl | A| O| E| U| I| D| H| T| N| S| -|Ent/Ctrl|
  69. * |--------------------------------------------------------------|
  70. * |Shift | ;| Q| J| K| X| B| M| W| V| Z|Shift |Fn0|
  71. * `--------------------------------------------------------------'
  72. * |Alt|Gui | Space/UTIL |Gui |Alt|
  73. * `-------------------------------------------'
  74. *
  75. */
  76. [DVOR] = KEYMAP(
  77. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, \
  78. KC_TAB, LT(MREC, KC_QUOT), KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, \
  79. KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, CTL_T(KC_ENT), \
  80. KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, MO(HHKB), \
  81. KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
  82. /* HHKB Layer: HHKB mode (HHKB Fn)
  83. *
  84. * ,-----------------------------------------------------------.
  85. * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
  86. * |-----------------------------------------------------------|
  87. * |Caps |PLA|PRV|NXT| | | | |Psc|Slk|Pus|Up | |Backs|
  88. * |-----------------------------------------------------------|
  89. * | |VoD|VoU|Mut|Ejc| | *| /|Hom|PgU|Lef|Rig|Enter |
  90. * |-----------------------------------------------------------|
  91. * | | | | | | | +| -|End|PgD|Dow| | |
  92. * `-----------------------------------------------------------'
  93. * | | | |STOP | |
  94. * `-------------------------------------------'
  95. */
  96. [HHKB] = KEYMAP(
  97. KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
  98. KC_CAPS, KC_MPLY, KC_MPRV, KC_MNXT, ____, ____, ____, ____, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ____, KC_BSPC, \
  99. ____, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, ____, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
  100. ____, ____, ____, ____, ____, ____, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ____, ____, \
  101. ____, ____, ____, KC_MSTP, ____),
  102. /* UTIL Layer: Extra utilities
  103. *
  104. * ,-------------------------------------------------------------.
  105. * |DFU|PLY1|PLY2| | | | | | | | |QWE|COL|DVO|DBG|
  106. * |-------------------------------------------------------------|
  107. * | |MLB |M-Up|MRB|MwU| |Hom|PgD|PgU|End| | | | |
  108. * |-------------------------------------------------------------|
  109. * | |M-Lt|M-Dn|M-R|MwD| |LEF|DOW|UP |RIG| | | |
  110. * |-------------------------------------------------------------|
  111. * | | | | | |SPC| | | | | | | |
  112. * `-------------------------------------------------------------'
  113. * | | | | | |
  114. * `-------------------------------------------'
  115. *
  116. */
  117. [UTIL] = KEYMAP(
  118. RESET, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, ____, ____, ____, ____, ____, ____, ____, ____, DF(QWER), DF(COLE), DF(DVOR), DEBUG, \
  119. ____, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, ____, KC_HOME, KC_PGDN, KC_PGUP, KC_END, ____, ____, ____, ____, \
  120. ____, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, ____, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, ____, ____, ____, \
  121. ____, ____, ____, ____, ____, KC_SPC, ____, ____, ____, ____, ____, ____, ____, \
  122. ____, ____, ____, ____, ____),
  123. /* MREC Layer: Record macros with `q`
  124. *
  125. * ,-------------------------------------------------------------.
  126. * | |REC1|REC2| | | | | | | | | | | | |
  127. * |-------------------------------------------------------------|
  128. * | | | | | | | | | | | | | | |
  129. * |-------------------------------------------------------------|
  130. * | | |RSTP| | | | | | | | | | |
  131. * |-------------------------------------------------------------|
  132. * | | | | | | | | | | | | | |
  133. * `-------------------------------------------------------------'
  134. * | | | | | |
  135. * `-------------------------------------------'
  136. *
  137. */
  138. [MREC] = KEYMAP(
  139. ____, DYN_REC_START1, DYN_REC_START2, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
  140. ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
  141. ____, ____, DYN_REC_STOP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
  142. ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
  143. ____, ____, ____, ____, ____)
  144. };
  145. const uint16_t PROGMEM fn_actions[] = {
  146. };
  147. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
  148. return MACRO_NONE;
  149. };
  150. // For Dynamic Macros.
  151. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  152. if (!process_record_dynamic_macro(keycode, record)) {
  153. return false;
  154. }
  155. return true;
  156. }