2
0

keymap.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. #include "acr60.h"
  2. #define _DFT 0
  3. #define _NGUI 1
  4. #define _FN 2
  5. #define _SFX 3
  6. // Fillers to make layering more clear
  7. #define ______ KC_TRNS
  8. #define bbbbbb KC_NO
  9. #define GUIOFF MAGIC_NO_GUI
  10. #define GUION MAGIC_UNNO_GUI
  11. #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
  12. /* TODO: create handy quick-ref list here for easy grokking of the actual shortcuts in place */
  13. /*
  14. * This is Mitch's default ACR60 layout (also DZ60, on which the ACR60 is based). This is a
  15. * Mac-oriented layout, as noted by the GUI keys immediately next to the space bar area of the
  16. * lower modifier row. This uses the MITCHSPLIT keymap as defined in arc60.h, which uses a
  17. * 3-split space bar and a split right shift. Otherwise it's a standard 60% layout (for now).
  18. *
  19. * For me, this is a great place to start getting used to a split key setup and still mostly
  20. * sticking to a standard staggered 60% layout so my entire game isn't thrown off.
  21. *
  22. * Layers (0-based index because we're devs!):
  23. *
  24. * 0: Default QWERTY layer
  25. * Note Fn and Alt keys on the right side of the spacebar, not sure if those are
  26. * normal position but that's what I'm used to at this point. YMMV
  27. *
  28. * 1: Function Layer
  29. * Function keys, Grave Key, Delete, Caps lock on the tab, media keys, and directional
  30. * keys. Also you can hit the Alt key position to switch (and lock) into the 3rd layer
  31. * if you really want to mess with your SFX for a bit.
  32. *
  33. * 2: Special Effects Layer
  34. * RGB and backlight settings access. RGB cycle on "S" key position and if locked into
  35. * the third layer you can hold shift to cycle backwards (see notes below). Bootloader
  36. * access is on this layer. If layer locked, hit right Alt key to get back to layer 0.
  37. *
  38. * The keymap layer definitions below look pretty bad when soft-wrapped by your IDE / text editor.
  39. * Be sure to disable wrapping to make things more readable with lines preserved.
  40. */
  41. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  42. /* Layer 0
  43. * ,-----------------------------------------------------------------------------------------.
  44. * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bksp |
  45. * |-----------------------------------------------------------------------------------------+
  46. * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
  47. * |-----------------------------------------------------------------------------------------+
  48. * | Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
  49. * |-----------------------------------------------------------------------------------------+
  50. * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
  51. * |-----------------------------------------------------------------------------------------+
  52. * | LCtrl | LAlt | LGUI | Space | Space| Space | RGUI | Fn | RAlt | RCtrl |
  53. * `-----------------------------------------------------------------------------------------'
  54. */
  55. /* Qwerty gui/alt/space/alt/gui /
  56. *
  57. * Hit MO(_FN) and Alt in that order to lock into the _FN layer.
  58. */
  59. [_DFT] = MITCHSPLIT( /* Basic QWERTY */
  60. F(0), 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_BSPC, \
  61. KC_TAB, 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_BSLS, \
  62. MO(_FN), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
  63. 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(_FN), \
  64. KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(_FN), LT(_SFX, KC_RALT),KC_RCTL \
  65. ),
  66. /* Gaming
  67. * ,-----------------------------------------------------------------------------------------.
  68. * | | | | | | | | | | | | | | | |
  69. * |-----------------------------------------------------------------------------------------+
  70. * | | | | | | | | | | | | | | |
  71. * |-----------------------------------------------------------------------------------------+
  72. * | | | | | | | | | | | | | |
  73. * |-----------------------------------------------------------------------------------------+
  74. * | | | | | | | | | | | | | |
  75. * |-----------------------------------------------------------------------------------------+
  76. * | | |BLOCKED| | | |BLOCKED| | | |
  77. * `-----------------------------------------------------------------------------------------'
  78. */
  79. /* I disable the GUI / System key for gaming, as usually that's windows and I hit that at the most
  80. * inopportune moments. And games don't use the windows key. I'd use the Bootmagic MAGIC_NO_GUI and
  81. * MAGIC_UNNO_GUI keycodes, but that actually disables it and has it persist beyond disconnection
  82. * of the board. That's less convenient (and more confusing) for me than this approach, which is
  83. * basically just blocking the GUI keys when this layer is active and not letting them flow through
  84. * to the default layer.
  85. */
  86. /* Layer 2: "special effects": RGB lighting, backlighting, bootloader */
  87. [_NGUI] = MITCHSPLIT(
  88. ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
  89. ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
  90. ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
  91. ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
  92. ______, ______, bbbbbb, ______, ______, ______, bbbbbb, ______, ______, ______ \
  93. ),
  94. /* Fn Layer / Layer 1
  95. * ,-----------------------------------------------------------------------------------------.
  96. * |KC_GRV| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del |
  97. * |-----------------------------------------------------------------------------------------+
  98. * | CAPS | | | | | |Home | Pgup| Up | PgDn| End | | | |
  99. * |-----------------------------------------------------------------------------------------+
  100. * | | Vol-| Vol+| Mute| | | | Left| Down|Right| | | |
  101. * |-----------------------------------------------------------------------------------------+
  102. * | |Prev |Play |Next | | | | | | | | | |
  103. * |-----------------------------------------------------------------------------------------+
  104. * | | | | | | | | | LrSfx | |
  105. * `-----------------------------------------------------------------------------------------'
  106. */
  107. /*
  108. * Pok3r-style layer switching on M and "," keys (_DFT and _NGUI layers, respectively). Note that
  109. * these don't enable/disable those layers (i.e. latching keys), they actually switch to that layer.
  110. * To go to the _NGUI layer, Fn+comma, to go to _DFT from _NGUI, hit Fn+M.
  111. */
  112. /* Layer 1: Functions, primary layer switching, media controls, directional */
  113. [_FN] = MITCHSPLIT(
  114. KC_GRV, 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_DEL, \
  115. KC_CAPS, bbbbbb, bbbbbb, bbbbbb, bbbbbb, bbbbbb, KC_HOME, KC_PGUP, KC_UP , KC_PGDOWN,KC_END, bbbbbb, bbbbbb, bbbbbb, \
  116. ______, KC_VOLD, KC_VOLU, KC_MUTE, bbbbbb, bbbbbb, bbbbbb, KC_LEFT, KC_DOWN, KC_RIGHT, bbbbbb, bbbbbb, ______, \
  117. ______, KC_MPRV, KC_MPLY, KC_MNXT, bbbbbb, bbbbbb, bbbbbb,TO(_DFT),TO(_NGUI), bbbbbb, bbbbbb, ______, ______, \
  118. ______, ______, ______, ______, ______, ______, ______, ______,TG(_SFX),______ \
  119. ),
  120. /* Special Effects Layer / Layer 2
  121. * ,-----------------------------------------------------------------------------------------.
  122. * | |Plain|Brth |Rnbw |Swirl|Snake|Knght|Xmas |Grdnt| | | | | | |
  123. * |-----------------------------------------------------------------------------------------+
  124. * | | BL |BLSTEP| BL- | BL+ | | | | | | | | |Bootldr |
  125. * |-----------------------------------------------------------------------------------------+
  126. * | | RGBT| RGBM| | | | | | | | | | |
  127. * |-----------------------------------------------------------------------------------------+
  128. * | | Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | |
  129. * |-----------------------------------------------------------------------------------------+
  130. * | | | | | | | | |LrDflt | |
  131. * `-----------------------------------------------------------------------------------------'
  132. */
  133. /* Tap RAlt to get back to default layer (0).
  134. *
  135. * See https://docs.qmk.fm/feature_rgblight.html#rgblight-keycodes for details about
  136. * RGB codes. Quick summary, though:
  137. *
  138. * RGB_MODE_PLAIN RGB_M_P Switch to the static no animation mode
  139. * RGB_MODE_BREATHE RGB_M_B Switch to the breathing mode
  140. * RGB_MODE_RAINBOW RGB_M_R Switch to the rainbow mode (cycles through colors)
  141. * RGB_MODE_SWIRL RGB_M_SW Switch to the swirl mode (like an animated gradient)
  142. * RGB_MODE_SNAKE RGB_M_SN Switch to the snake mode
  143. * RGB_MODE_KNIGHT RGB_M_K Switch to the knight animation
  144. * RGB_MODE_XMAS RGB_M_X Switch to the Christmas animation
  145. * RGB_MODE_GRADIENT RGB_M_G Switch to the static gradient mode
  146. *
  147. * Note that there are more animation variations, usually timer-based variations, by using the
  148. * "S" key to cycle through modes. Use one of the deciated keys to get to
  149. * the general mode where you want it, then cycle through variations of that mode to get
  150. * something specific more quickly.
  151. */
  152. /* Layer 2: "special effects": RGB lighting, backlighting, bootloader */
  153. [_SFX] = MITCHSPLIT(
  154. ______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_M_X, RGB_M_G,______, ______, ______, ______, ______, \
  155. ______, BL_TOGG, BL_STEP, BL_DEC, BL_INC, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \
  156. ______, RGB_TOG, RGB_MOD,______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
  157. ______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, \
  158. ______, ______, ______, ______, ______, ______, ______, ______,TO(_DFT),______ \
  159. )
  160. };
  161. enum function_id {
  162. SHIFT_ESC,
  163. };
  164. const uint16_t PROGMEM fn_actions[] = {
  165. [0] = ACTION_FUNCTION(SHIFT_ESC),
  166. };
  167. void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
  168. static uint8_t shift_esc_shift_mask;
  169. switch (id) {
  170. case SHIFT_ESC:
  171. shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
  172. if (record->event.pressed) {
  173. if (shift_esc_shift_mask) {
  174. add_key(KC_GRV);
  175. send_keyboard_report();
  176. } else {
  177. add_key(KC_ESC);
  178. send_keyboard_report();
  179. }
  180. } else {
  181. if (shift_esc_shift_mask) {
  182. del_key(KC_GRV);
  183. send_keyboard_report();
  184. } else {
  185. del_key(KC_ESC);
  186. send_keyboard_report();
  187. }
  188. }
  189. break;
  190. }
  191. }