summaryrefslogtreecommitdiffstats
path: root/keyboards/keebio/bfo9000/keymaps/tuesdayjohn/keymap.c
blob: e42f6797e70553b3cab45ec9736dcd8d174a8974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
#include QMK_KEYBOARD_H

extern keymap_config_t keymap_config;

enum bfo9000_layers {
  _COLEMAK,   // Colemak (default layer)
  _QWERTY,    // Qwerty
  _GAMING,    // Gaming/vanilla toggle layer (limited dual-role keys and layer access)
  _NUMBERS,   // Numbers & Symbols
  _NUMBERS2,  // Numbers & Symbols 2 (identical as _NUMBERS; basically used for tri-layer access to _ADJUST)
  _FUNCTION,  // Function
  _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows)
  _NUMPAD,    // Numpad
  _ADJUST,    // Adjust layer (accessed via tri-layer feature)
  _ADJUST2    // Second Adjust layer (accessed outside of tri-layer feature)
};

enum bfo9000_keycodes {
  COLEMAK = SAFE_RANGE,
  QWERTY,
  GAMING
};

//Tap Dance Declarations
enum {
  ADJ = 0,
  LBCB,
  RBCB,
  EQPL,
  PLEQ,
  MNUN,
  SLAS,
  GVTL,
  PPEQ,
  PMUN,
  PSPA
};

void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) {
  if (state->count == 2) {
     layer_on(_ADJUST2);
     set_oneshot_layer(_ADJUST2, ONESHOT_START);
  }
}
void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) {
  if (state->count == 2) {
     layer_off(_ADJUST2);
     clear_oneshot_layer_state(ONESHOT_PRESSED);
  }
}

qk_tap_dance_action_t tap_dance_actions[] = {
[ADJ]  = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset),  //  Double-tap to activate Adjust layer via oneshot layer 
[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR),  // Left bracket on a single-tap, left brace on a double-tap
[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR),  // Right bracket on a single-tap, right brace on a double-tap
[EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS),   // Plus sign on a single-tap, equal sign on a double-tap
[PLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQL),   // Equal sign on a single-tap, plus sign on a double-tap
[MNUN] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS),  // Minus sign on a single-tap, underscore on a double-tap
[SLAS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ASTR),  // Slash in a single-tap, asterisk in a double-tap
[GVTL] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD),   // Grave on a single-tap, tilde on a double-tap
[PPEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PPLS, KC_EQL),   // Numpad plus sign on a single-tap, equal sign on a double-tap
[PMUN] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_UNDS),  // Numpad minus sign on a single-tap, underscore on a double-tap
[PSPA] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST)   // Numpad slash on a single-tap, numpad asterisk on a double-tap
};

//Aliases for longer keycodes
#define NUMPAD  TG(_NUMPAD)
#define ADJUST  MO(_ADJUST2)
#define SPCFN   LT(_FUNCTION, KC_SPC)
#define BSPCFN  LT(_FUNCTION2, KC_BSPC)
#define ENTNS   LT(_NUMBERS, KC_ENT)
#define DELNS   LT(_NUMBERS2, KC_DEL)
#define CTLESC  CTL_T(KC_ESC)
#define ALTAPP  ALT_T(KC_APP)
#define CTL_A   LCTL(KC_A)
#define CTL_C   LCTL(KC_C)
#define CTL_V   LCTL(KC_V)
#define CTL_X   LCTL(KC_X)
#define CTL_Z   LCTL(KC_Z)
#define CTL_Y   LCTL(KC_Y)
#define CA_TAB  LCA(KC_TAB)
#define HYPER   ALL_T(KC_NO)
#define TD_ADJ  TD(ADJ)
#define TD_LBCB TD(LBCB)
#define TD_RBCB TD(RBCB)
#define TD_EQPL TD(EQPL)
#define TD_PLEQ TD(PLEQ)
#define TD_MNUN TD(MNUN)
#define TD_SLAS TD(SLAS)
#define TD_GVTL TD(GVTL)
#define TD_PPEQ TD(PPEQ)
#define TD_PMUN TD(PMUN)
#define TD_PSPA TD(PSPA)
#define NKROTG  MAGIC_TOGGLE_NKRO

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
Colemak
(Default layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts)
 ,--------------------------------------------------------------------------------.   ,--------------------------------------------------------------------------------. 
 |   ESC  |   F1   |   F2   |   F3   |   F4   |   F5   |        |        |        |   | Adjust |        |   F12  |   F6   |   F7   |   F8   |   F9   |   F10  |   F11  |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |    =   |    1   |    2   |    3   |    4   |    5   |        |        |        |   | Numpad |        |        |    6   |    7   |    8   |    9   |    0   |    -   |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |   Tab  |    Q   |    W   |    F   |    P   |    G   |        |        |  Home  |   | Pause  |        |        |    J   |    L   |    U   |    Y   |    ;   |    \   |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 | Esc/Ctl|    A   |    R   |    S   |    T   |    D   |        |        |  PgUp  |   | ScrLck |        |        |    H   |    N   |    E   |    I   |    O   |    '   |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 | SCShift|    Z   |    X   |    C   |    V   |    B   | Esc/Ctl| App/Alt|  PgDn  |   | PrtScr |  RAlt  |  RCtl  |    K   |    M   |    ,   |    .   |    /   | SCShift|
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |   Ins  |    `   |    [   |    ]   | App/Alt| Spc/Fn | Ent/NS |  Bspc  |   End  |   |        |  Enter | Del/NS2| Bsp/Fn2|  RGUI  |  Left  |  Down  |   Up   |  Right |
 `--------------------------------------------------------------------------------'   `--------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT( \
  KC_ESC,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   _______, _______, _______,     ADJUST,  _______, KC_F12,  KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,
  KC_EQL,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    _______, _______, _______,     NUMPAD,  _______, _______, KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS,  
  KC_TAB,  KC_Q,    KC_W,    KC_F,    KC_P,    KC_G,    _______, _______, KC_HOME,     KC_PAUS, _______, _______, KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN, KC_BSLS,    
  CTLESC,  KC_A,    KC_R,    KC_S,    KC_T,    KC_D,    _______, _______, KC_PGUP,     KC_SLCK, _______, _______, KC_H,    KC_N,    KC_E,    KC_I,    KC_O,    KC_QUOT,  
  KC_LSPO, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    CTLESC,  ALTAPP,  KC_PGDN,     KC_PSCR, KC_RALT, KC_RCTL, KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSPC,   
  KC_INS,  KC_GRV,  KC_LBRC, KC_RBRC, ALTAPP,  SPCFN,   ENTNS,   KC_BSPC, KC_END,      _______, KC_ENT,  DELNS,   BSPCFN,  KC_RGUI, KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT 
),

/*
QWERTY
(Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts)
 ,--------------------------------------------------------------------------------.   ,--------------------------------------------------------------------------------. 
 |   ESC  |   F1   |   F2   |   F3   |   F4   |   F5   |        |        |        |   | Adjust |        |   F12  |   F6   |   F7   |   F8   |   F9   |   F10  |   F11  |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |    =   |    1   |    2   |    3   |    4   |    5   |        |        |        |   | Numpad |        |        |    6   |    7   |    8   |    9   |    0   |    -   |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |   Tab  |    Q   |    W   |    E   |    R   |    T   |        |        |  Home  |   |  Pause |        |        |    Y   |    U   |    I   |    O   |    P   |    \   |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 | Esc/Ctl|    A   |    S   |    D   |    F   |    G   |        |        |  PgUp  |   | ScrLck |        |        |    H   |    J   |    K   |    L   |    ;   |    '   |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 | SCShift|    Z   |    X   |    C   |    V   |    B   | Esc/Ctl| App/Alt|  PgDn  |   | PrtScr |  RAlt  |  RCtl  |    N   |    M   |    ,   |    .   |    /   | SCShift|
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |   Ins  |    `   |    [   |    ]   | App/Alt| Spc/Fn | Ent/NS |  Bspc  |   End  |   |        |  Enter | Del/NS2| Bsp/Fn2|  RGUI  |  Left  |  Down  |   Up   |  Right |
 `--------------------------------------------------------------------------------'   `--------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT( \
  KC_ESC,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,   KC_F8,       ADJUST,  _______, KC_F12,  KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,
  KC_EQL,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,        NUMPAD,  _______, _______, KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS,  
  KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_HOME,     KC_PAUS, _______, _______, KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSLS,    
  CTLESC,  KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_PGUP,     KC_SLCK, _______, _______, KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT,  
  KC_LSPO, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    CTLESC,  ALTAPP,  KC_PGDN,     KC_PSCR, KC_RALT, KC_RCTL, KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSPC,   
  KC_INS,  KC_GRV,  KC_LBRC, KC_RBRC, ALTAPP,  SPCFN,   ENTNS,   KC_BSPC, KC_END,      _______, KC_ENT,  DELNS,   BSPCFN,  KC_RGUI, KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT 
),

/*
Numbers/Symbols layer
(Multiple characters: single-tap for first, double-tap for second)
 ,--------------------------------------------------------------------------------.   ,--------------------------------------------------------------------------------. 
 |        |        |        |        |        |        |        |        |        |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |   F12  |   F1   |   F2   |   F3   |   F4   |   F5   |        |        |        |   |        |        |        |   F6   |   F7   |   F8   |   F9   |   F10  |   F12  |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |    6   |    7   |    8   |    9   |    0   |        |        |        |   |        |        |        |    ^   |    &   |    *   |    (   |    )   |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |    1   |    2   |    3   |    4   |    5   |        |        |        |   |        |        |        |    !   |    @   |    #   |    $   |    %   |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |    .   |   / *  |   - _  |   + =  |        |        |        |   |        |        |        |   ` ~  |   [ {  |   ] }  |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |    (   |    )   |   [ {  |   ] }  |        |        |        |        |        |   |        |        |        |        |        |        |        |        |        |
 `--------------------------------------------------------------------------------'   `--------------------------------------------------------------------------------'
*/
[_NUMBERS] = LAYOUT( \
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  KC_F12,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   _______, _______, _______,     _______, _______, _______, KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,
  _______, KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    _______, _______, _______,     _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
  _______, KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    _______, _______, _______,     _______, _______, _______, KC_EXLM, KC_AT,   KC_HASH, KC_DLR,  KC_PERC, _______,
  _______, _______, KC_DOT,  TD_SLAS, TD_MNUN, TD_PLEQ, _______, _______, _______,     _______, _______, _______, TD_GVTL, TD_LBCB, TD_RBCB, _______, _______, _______,
  KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______
),

[_NUMBERS2] = LAYOUT( \
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  KC_F12,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   _______, _______, _______,     _______, _______, _______, KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,
  _______, KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    _______, _______, _______,     _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
  _______, KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    _______, _______, _______,     _______, _______, _______, KC_EXLM, KC_AT,   KC_HASH, KC_DLR,  KC_PERC, _______,
  _______, _______, KC_DOT,  TD_SLAS, TD_MNUN, TD_PLEQ, _______, _______, _______,     _______, _______, _______, TD_GVTL, TD_LBCB, TD_RBCB, _______, _______, _______,
  KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______
),

/*
Function layer
 ,--------------------------------------------------------------------------------.   ,--------------------------------------------------------------------------------. 
 |        |        |        |        |        |        |        |        |        |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |   F12  |   F1   |   F2   |   F3   |   F4   |   F5   |        |        |        |   |        |        |        |   F6   |   F7   |   F8   |   F9   |   F10  |   F12  |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |        |   Up   |        |        |        |        |        |   |        |        |        |        |        |   Up   | Ctrl+Y |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        | Ctrl+A |  Left  |  Down  |  Right | C+A+Tb |        |        |        |   |        |        |        |  PgUp  |  Right |  Down  |  Left  |  Home  |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        | Ctrl+Z | Ctrl+X | Ctrl+C | Ctrl+V |  Bspc  |        |        |        |   |        |        |        |  PgDn  |  Mute  |  Vol-  |  Vol+  |   End  |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |        |        |        |        |        |        |        |   |        |        |        |        |        |  Prev  |  Play  |  Next  |  Stop  |
 `--------------------------------------------------------------------------------'   `--------------------------------------------------------------------------------'
*/
[_FUNCTION] = LAYOUT(
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  KC_F12,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   _______, _______, _______,     _______, _______, _______, KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,
  _______, _______, _______, KC_UP,   _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, KC_UP,   CTL_Y,   _______, _______,
  _______, CTL_A,   KC_LEFT, KC_DOWN, KC_RGHT, CA_TAB,  _______, _______, _______,     _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______,
  _______, CTL_Z,   CTL_X,   CTL_C,   CTL_V,   KC_BSPC, _______, _______, _______,     _______, _______, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END,  _______,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP
),

[_FUNCTION2] = LAYOUT(
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  KC_F12,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   _______, _______, _______,     _______, _______, _______, KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,
  _______, _______, _______, KC_UP,   _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, KC_UP,   CTL_Y,   _______, _______,
  _______, CTL_A,   KC_LEFT, KC_DOWN, KC_RGHT, CA_TAB,  _______, _______, _______,     _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______,
  _______, CTL_Z,   CTL_X,   CTL_C,   CTL_V,   KC_BSPC, _______, _______, _______,     _______, _______, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END,  _______,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP
),

/*
Numpad layer
(Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout)
 ,--------------------------------------------------------------------------------.   ,--------------------------------------------------------------------------------. 
 |        |        |        |        |        |        |        |        |        |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |  NumLk |        |        |        |        |        |        |        |   |        |        |   Tab  |  NumLk |  KP /  |  KP *  |  KP -  |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |  KP 6  |  KP 7  |   KP 8 |  KP 9  |  KP 0  |        |        |        |   |        |        |        |  KP 7  |  KP 8  |  KP 9  |  KP +  |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |  KP 1  |  KP 2  |   KP 3 |  KP 4  |  KP 5  |        |        |        |   |        |        |        |  KP 4  |  KP 5  |  KP 6  |    =   |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |  KP .  | KP/ KP*|  KP- _ |  KP+ = |        |        |        |   |        |        |        |  KP 1  |  KP 2  |  KP 3  | KP Ent |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |    (   |    )   |   [ {  |   ] }  |        |        |        |        |        |   |        |        |        |        |  KP 0  |  KP .  | KP Ent |        |        |
 `--------------------------------------------------------------------------------'   `--------------------------------------------------------------------------------'
*/
[_NUMPAD] = LAYOUT( \
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  _______, KC_NLCK, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, KC_TAB,  KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______,
  _______, KC_P6,   KC_P7,   KC_P8,   KC_P9,   KC_P0,   _______, _______, _______,     _______, _______, _______, _______, KC_P7,   KC_P8,   KC_P9,   KC_PPLS, _______,
  _______, KC_P1,   KC_P2,   KC_P3,   KC_P4,   KC_P5,   _______, _______, _______,     _______, _______, _______, _______, KC_P4,   KC_P5,   KC_P6,   KC_EQL,  _______,
  _______, _______, KC_PDOT, TD_PSPA, TD_PMUN, TD_PPEQ, _______, _______, _______,     _______, _______, _______, _______, KC_P1,   KC_P2,   KC_P3,   KC_PENT, _______,
  KC_LPRN, KC_RPRN, TD_LBCB, TD_RBCB, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, KC_P0,   KC_PDOT, KC_PENT, _______
),

/*
Gaming
(Toggle gaming layer with limited dual-role keys and layer access; NKRO turned on by default; Ent/NS + Delete/Numbers2 to access Adjust layer)
 ,--------------------------------------------------------------------------------.   ,--------------------------------------------------------------------------------. 
 |        |        |        |        |        |        |   F6   |   F7   |   F8   |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |        |        |        |        |    6   |    7   |    8   |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |        |        |        |        |    J   |    L   |        |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |  LCtl  |        |        |        |        |        |    H   |    N   |        |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |  Shift |        |        |        |        |        |   Esc  |  LAlt  |        |   |        |  RAlt  |  RCtl  |        |        |        |        |        |  Shift |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |        |        |  LAlt  |  Space |  Enter |  Bspc  |        |   |        | Ent/NS | Del/NS2| Bsp/Fn2|  RGUI  |        |        |        |        |
 `--------------------------------------------------------------------------------'   `--------------------------------------------------------------------------------'
*/
[_GAMING] = LAYOUT( \
  _______, _______, _______, _______, _______, _______, KC_F6,   KC_F7,   KC_F8,       _______, _______, _______, _______, _______, _______, _______, _______, _______,
  _______, _______, _______, _______, _______, _______, KC_6,    KC_7,    KC_8,        _______, _______, _______, _______, _______, _______, _______, _______, _______,  
  _______, _______, _______, _______, _______, _______, KC_J,    KC_L,    _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,    
  KC_LCTL, _______, _______, _______, _______, _______, KC_H,    KC_N,    _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,  
  KC_LSFT, _______, _______, _______, _______, _______, KC_ESC,  KC_LALT, _______,     _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT,   
  _______, _______, _______, _______, KC_LALT, KC_SPC,  KC_ENT,  KC_BSPC, _______,     _______, ENTNS,   _______, _______, _______, _______, _______, _______, _______ 
),

/*
Adjust layer
(Press and hold Adjust key on the function row or Enter/Number + Delete/Number2 to access; Numpad and NKRO are on toggle)
 ,--------------------------------------------------------------------------------.   ,--------------------------------------------------------------------------------. 
 |        |        |        |        |        |        |        |        |        |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        | Colemak| Qwerty |        | Gaming |        |        |        |        |   |        |        |        | Numpad |        |        |        |        |  RESET |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |        |        |        |        |        |        |        |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |        |        |        |        |        |        |        |   |        |        |        |        | NKROTG |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |        |        |        |        |        |        |        |   |        |        |        |        |        |        |        |        |        |
 |--------+--------+--------+--------+--------+--------+--------+--------+--------|   |--------+--------+--------+--------+--------+--------+--------+--------+--------|
 |        |        |        |        |        |        |        |        |        |   |        |        |        |        |        |        |        |        |        |
 `--------------------------------------------------------------------------------'   `--------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT(
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  _______, COLEMAK, QWERTY,  _______, GAMING,  _______, _______, _______, _______,     _______, _______, _______, NUMPAD,  _______, _______, _______, _______, RESET,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, NKROTG,  _______, _______, _______, _______,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______
),

[_ADJUST2] = LAYOUT(
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  _______, COLEMAK, QWERTY,  _______, GAMING,  _______, _______, _______, _______,     _______, _______, _______, NUMPAD,  _______, _______, _______, _______, RESET,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, NKROTG,  _______, _______, _______, _______,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______,
  _______, _______, _______, _______, _______, _______, _______, _______, _______,     _______, _______, _______, _______, _______, _______, _______, _______, _______
),

};

uint32_t layer_state_set_user(uint32_t state) {
  return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST);
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
	case COLEMAK:
      if (record->event.pressed) {
//        persistent_default_layer_set(1UL << _COLEMAK);
        default_layer_set(1UL << _COLEMAK);
        layer_move (_COLEMAK);
        keymap_config.nkro = 0;
	  }
      return false;
      break;
    case QWERTY:
      if (record->event.pressed) {
//        persistent_default_layer_set(1UL << _QWERTY);
        default_layer_set(1UL << _QWERTY);
        layer_move (_QWERTY);
        keymap_config.nkro = 0;
      }
      return false;
      break;
    case GAMING:
      if (record->event.pressed) {
        layer_invert (_GAMING);
        layer_off (_NUMPAD);
        keymap_config.nkro = 1;
	  }
      return false;
      break;
  }
  return true;
}