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