diff options
Diffstat (limited to 'layouts/community/ergodox/replicaJunction/keymap.c')
-rw-r--r-- | layouts/community/ergodox/replicaJunction/keymap.c | 336 |
1 files changed, 336 insertions, 0 deletions
diff --git a/layouts/community/ergodox/replicaJunction/keymap.c b/layouts/community/ergodox/replicaJunction/keymap.c new file mode 100644 index 000000000..fc8005927 --- /dev/null +++ b/layouts/community/ergodox/replicaJunction/keymap.c | |||
@@ -0,0 +1,336 @@ | |||
1 | /* | ||
2 | * Keyboard: Ergodox | ||
3 | * Keymap: replicaJunction | ||
4 | * Version: 1.2 | ||
5 | * | ||
6 | * This keymap is designed to complement my Atreus keyboard layout, found in keyboards/atreus. | ||
7 | * The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox, and I now | ||
8 | * have both keyboards, so I've designed these layouts in an effort to make switching between the | ||
9 | * two as easy as possible. | ||
10 | * | ||
11 | * I've also tried to make use of the extra keys on the Ergodox in as logical of a manner as possible, | ||
12 | * adding to the layers in the Atreus config without disturbing what's there already. This allows for | ||
13 | * things like F11-F20, the Application (Menu) key, and better media key placement. | ||
14 | * | ||
15 | * The default key layout in this keymap is Colemak-ModDH. Information on that layout can be found | ||
16 | * here: https://colemakmods.github.io/mod-dh/ | ||
17 | */ | ||
18 | |||
19 | #include QMK_KEYBOARD_H | ||
20 | #include "debug.h" | ||
21 | #include "action_layer.h" | ||
22 | |||
23 | #define _CO 0 // Colemak | ||
24 | #define _QW 1 // QWERTY | ||
25 | #define _ME 2 // media keys | ||
26 | #define _NU 3 // numpad | ||
27 | #define _EX 4 // extend | ||
28 | #define _GA 5 // mouse overlay for gaming | ||
29 | |||
30 | // Some quick aliases, just to make it look pretty | ||
31 | #define _______ KC_TRNS | ||
32 | #define KCX_CGR LCTL(KC_GRV) | ||
33 | #define KX_STAB LSFT(KC_TAB) | ||
34 | #define KX_COPY LCTL(KC_C) | ||
35 | #define KX_CUT LCTL(KC_X) | ||
36 | #define KX_PAST LCTL(KC_V) | ||
37 | #define KX_UNDO LCTL(KC_Z) | ||
38 | |||
39 | ; // This doesn't do anything. It's just for VSCode because its syntax highlighting is weird for the above #define statements. | ||
40 | |||
41 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
42 | /* | ||
43 | * Keymap: Colemak-ModDH | ||
44 | * | ||
45 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
46 | * | ` | 1 | 2 | 3 | 4 | 5 | Esc | | | 6 | 7 | 8 | 9 | 0 | = | | ||
47 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
48 | * | LCtrl | Q | W | F | P | B | Home | | BkSp | J | L | U | Y | ; | - | | ||
49 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
50 | * | Tab | A | R | S | T | G |------| |------| M | N | E | I | O | ' | | ||
51 | * |--------+------+------+------+------+------| Hyper| | \ |------+------+------+------+------+--------| | ||
52 | * | LShft | Z | X | C | D | V | | | | K | H | , | , | / | RShft | | ||
53 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
54 | * | LGui | [ | ] |CtlShf| LAlt | | _EX | - | ' | = | \ | | ||
55 | * `----------------------------------' `----------------------------------' | ||
56 | * ,-------------. ,-------------. | ||
57 | * | LCtrl| ~GA | | Left | Right| | ||
58 | * ,------|------|------| |------+------+------. | ||
59 | * |LCtrl/| LAlt/| Home | | Up | Alt/| _NU/ | | ||
60 | * | BkSp | Del |------| |------| Enter| Space| | ||
61 | * | | | _NU | | Down | | | | ||
62 | * `--------------------' `--------------------' | ||
63 | */ | ||
64 | [_CO] = LAYOUT_ergodox( | ||
65 | // left hand | ||
66 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, | ||
67 | KC_LCTL,KC_Q, KC_W, KC_F, KC_P, KC_B, KC_HOME, | ||
68 | KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_G, | ||
69 | KC_LSFT,KC_Z, KC_X, KC_C, KC_D, KC_V, ALL_T(KC_NO), | ||
70 | KC_LGUI,KC_LBRC,KC_RBRC, LCTL(KC_LSFT), KC_LALT, | ||
71 | |||
72 | KC_LCTL, TG(_GA), | ||
73 | KC_HOME, | ||
74 | CTL_T(KC_BSPC), ALT_T(KC_DEL), MO(_NU), | ||
75 | // right hand | ||
76 | KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, | ||
77 | KC_BSPC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_MINS, | ||
78 | KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, | ||
79 | KC_BSLS, KC_K, KC_H, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, | ||
80 | MO(_EX),KC_MINS,KC_QUOT,KC_EQL, KC_BSLS, | ||
81 | |||
82 | KC_LEFT, KC_RGHT, | ||
83 | KC_UP, | ||
84 | KC_DOWN, ALT_T(KC_ENT), LT(_NU,KC_SPC) | ||
85 | ), | ||
86 | |||
87 | /* | ||
88 | * Keymap: QWERTY layout. | ||
89 | * | ||
90 | * This is optimized for gaming, not typing, so there aren't as many macros | ||
91 | * as the Dvorak layer. Some of the keys have also been moved to "game- | ||
92 | * like" locations, such as making the spacebar available to the left thumb, | ||
93 | * and repositioning the arrow keys at the bottom right corner. | ||
94 | * | ||
95 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
96 | * | ` | 1 | 2 | 3 | 4 | 5 | Esc | | | 6 | 7 | 8 | 9 | 0 | = | | ||
97 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
98 | * | LCtrl | Q | W | E | R | T | Home | | BkSp | Y | U | I | O | P | - | | ||
99 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
100 | * | Tab | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | | ||
101 | * |--------+------+------+------+------+------| Hyper| | \ |------+------+------+------+------+--------| | ||
102 | * | LShft | Z | X | C | V | B | | | | N | M | , | . | / | RShft | | ||
103 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
104 | * | LGui | ` | \ |CtlShf| _NU | | _EX | - | ' | = | \ | | ||
105 | * `----------------------------------' `----------------------------------' | ||
106 | * ,-------------. ,-------------. | ||
107 | * | LCtrl| ~GA | | Left | Right| | ||
108 | * ,------|------|------| |------+------+------. | ||
109 | * |LCtrl/| LAlt/| Home | | Up | Alt/| _NU/ | | ||
110 | * | BkSp | Del |------| |------| Enter| Space| | ||
111 | * | | | _NU | | Down | | | | ||
112 | * `--------------------' `--------------------' | ||
113 | */ | ||
114 | [_QW] = LAYOUT_ergodox( // Layer1: QWERTY | ||
115 | // left hand | ||
116 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, | ||
117 | KC_LCTL,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME, | ||
118 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, | ||
119 | KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), | ||
120 | KC_LGUI,KC_GRV, KC_SLSH,LCTL(KC_LSFT), MO(_NU), | ||
121 | |||
122 | KC_LCTL,TG(_GA), | ||
123 | KC_HOME, | ||
124 | CTL_T(KC_BSPC), ALT_T(KC_DEL), MO(_NU), | ||
125 | // right hand | ||
126 | KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, | ||
127 | KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, | ||
128 | KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, | ||
129 | KC_BSLS, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, | ||
130 | MO(_EX),KC_MINS,KC_QUOT,KC_EQL, KC_BSLS, | ||
131 | |||
132 | KC_LEFT, KC_RGHT, | ||
133 | KC_UP, | ||
134 | KC_DOWN, ALT_T(KC_ENT), LT(_NU,KC_SPC) | ||
135 | ), | ||
136 | |||
137 | /* | ||
138 | * Keymap: Numbers and symbols | ||
139 | * | ||
140 | * Note that the number keys here are actually numpad keystrokes. This often doesn't matter, but it may be relevant in a few cases. | ||
141 | * That's why the Num Lock key exists on this layer - just in case. | ||
142 | * | ||
143 | * This layer also contains the layout switches. | ||
144 | * | ||
145 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
146 | * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | | ||
147 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
148 | * | | ! | @ | { | } | & | | | | / | 7 | 8 | 9 | * | | | ||
149 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
150 | * | | # | $ | ( | ) | ~ |------| |------| | | 4 | 5 | 6 | - | | | ||
151 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
152 | * | | % | ^ | [ | ] | ` | | | | \ | 1 | 2 | 3 | + | | | ||
153 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
154 | * | |QWERTY|Colemk| | | | 0 | . | = | | | | ||
155 | * `----------------------------------' `----------------------------------' | ||
156 | * ,-------------. ,-------------. | ||
157 | * |NumLck| RESET| | | | | ||
158 | * ,------|------|------| |------+------+------. | ||
159 | * | | | | | | | | | ||
160 | * | | |------| |------| | | | ||
161 | * | | | | | | | | | ||
162 | * `--------------------' `--------------------' | ||
163 | */ | ||
164 | [_NU] = LAYOUT_ergodox( | ||
165 | // left hand | ||
166 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, | ||
167 | _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_AMPR, _______, | ||
168 | _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_TILD, | ||
169 | _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_GRV, _______, | ||
170 | _______, DF(_QW), DF(_CO), _______, _______, | ||
171 | |||
172 | KC_NLCK,RESET, | ||
173 | _______, | ||
174 | _______,_______,_______, | ||
175 | // right hand | ||
176 | _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, | ||
177 | _______, KC_SLSH, KC_P7, KC_P8, KC_P9, KC_PAST, _______, | ||
178 | KC_PIPE, KC_P4, KC_P5, KC_P6, KC_PMNS, _______, | ||
179 | _______, KC_BSLS, KC_P1, KC_P2, KC_P3, KC_PPLS, _______, | ||
180 | KC_P0, KC_PDOT, KC_EQL, _______, _______, | ||
181 | |||
182 | _______, _______, | ||
183 | _______, | ||
184 | _______, _______, _______ | ||
185 | ), | ||
186 | |||
187 | /* | ||
188 | * Keymap: Extend | ||
189 | * | ||
190 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
191 | * | | F11 | F12 | F13 | F14 | F15 | Mute | | | F16 | F17 | F18 | F19 | F20 | | | ||
192 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
193 | * | | | | | | Ctrl`| Vol | | | PgUp | Home | Up | End | Del | | | ||
194 | * |--------+------+------+------+------+------| Up | | |------+------+------+------+------+--------| | ||
195 | * | | | Gui | Alt | Ctrl | |------| |------| PgDn | Left | Down | Right| BkSp | Menu | | ||
196 | * |--------+------+------+------+------+------| Vol | | |------+------+------+------+------+--------| | ||
197 | * | | Undo | Cut | Copy | | Paste| Down | | | | ^Tab | Tab | |Insert| PrntScr| | ||
198 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
199 | * | | | | | | | | | | | | | ||
200 | * `----------------------------------' `----------------------------------' | ||
201 | * ,-------------. ,-------------. | ||
202 | * | | | | | | | ||
203 | * ,------|------|------| |------+------+------. | ||
204 | * | | | | | | | | | ||
205 | * | | |------| |------| | | | ||
206 | * | | | | | | | | | ||
207 | * `--------------------' `--------------------' | ||
208 | * | ||
209 | * Ctrl+` is a keyboard shortcut for the program ConEmu, which provides a Quake-style drop-down command prompt. | ||
210 | * | ||
211 | */ | ||
212 | [_EX] = LAYOUT_ergodox( | ||
213 | // left hand | ||
214 | _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_MUTE, | ||
215 | _______, _______, _______, _______, _______, KCX_CGR, KC_VOLU, | ||
216 | _______, _______, KC_LGUI, KC_LALT, KC_LCTL, _______, | ||
217 | _______, KX_UNDO, KX_CUT, KX_COPY, _______, KX_PAST, KC_VOLD, | ||
218 | _______, _______, _______, _______, _______, | ||
219 | |||
220 | _______,_______, | ||
221 | _______, | ||
222 | _______,_______,_______, | ||
223 | // right hand | ||
224 | _______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, | ||
225 | _______, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, _______, | ||
226 | KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, KC_MENU, | ||
227 | _______, _______, KX_STAB, KC_TAB, _______, KC_INS, KC_PSCR, | ||
228 | _______, _______, _______, _______, _______, | ||
229 | _______, _______, | ||
230 | _______, | ||
231 | _______, _______, _______ | ||
232 | ), | ||
233 | |||
234 | /* | ||
235 | * Keymap: Gaming | ||
236 | * | ||
237 | * Provides a mouse overlay for the right hand, and also moves some "gamer friendly" keys to the left, such as space. | ||
238 | * This layer also removes a lot of dual-role keys, as when gaming, it's nicer not to need to keep track of those. | ||
239 | * | ||
240 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
241 | * | | | | | | | | | | | | | | | | | ||
242 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
243 | * | | | | | | | | | | |WhlUp | MsUp |WhlDn | | | | ||
244 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
245 | * | | | | | | |------| |------| |MsLeft|MsDown|MsRght| | | | ||
246 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
247 | * | | | | | | | | | | | | | | | | | ||
248 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
249 | * | LCtrl| | | | | | | | | | | | ||
250 | * `----------------------------------' `----------------------------------' | ||
251 | * ,-------------. ,-------------. | ||
252 | * | | ~_GA | | |MClick| | ||
253 | * ,------|------|------| |------+------+------. | ||
254 | * | | | | | | | | | ||
255 | * | Space| |------| |------|RClick|LClick| | ||
256 | * | | | | | | | | | ||
257 | * `--------------------' `--------------------' | ||
258 | */ | ||
259 | [_GA] = LAYOUT_ergodox( | ||
260 | // left hand | ||
261 | _______, _______, _______, _______, _______, _______, _______, | ||
262 | _______, _______, _______, _______, _______, _______, _______, | ||
263 | _______, _______, _______, _______, _______, _______, | ||
264 | _______, _______, _______, _______, _______, _______, _______, | ||
265 | KC_LCTL, _______, _______, _______, _______, | ||
266 | |||
267 | _______,_______, | ||
268 | _______, | ||
269 | KC_SPC, _______,_______, | ||
270 | |||
271 | // right hand | ||
272 | _______, _______, _______, _______, _______, _______, _______, | ||
273 | _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, | ||
274 | _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, | ||
275 | _______, _______, _______, _______, _______, _______, _______, | ||
276 | _______, _______, _______, _______, _______, | ||
277 | _______, KC_BTN3, | ||
278 | _______, | ||
279 | _______, KC_BTN2, KC_BTN1 | ||
280 | ), | ||
281 | }; | ||
282 | |||
283 | const uint16_t PROGMEM fn_actions[] = { | ||
284 | [1] = ACTION_LAYER_TAP_TOGGLE(_NU) // FN1 - Momentary Layer 1 (Numbers and symbols) | ||
285 | }; | ||
286 | |||
287 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | ||
288 | { | ||
289 | // MACRODOWN only works in this function | ||
290 | switch(id) { | ||
291 | case 0: | ||
292 | if (record->event.pressed) { | ||
293 | register_code(KC_RSFT); | ||
294 | } else { | ||
295 | unregister_code(KC_RSFT); | ||
296 | } | ||
297 | break; | ||
298 | } | ||
299 | return MACRO_NONE; | ||
300 | }; | ||
301 | |||
302 | // Runs just one time when the keyboard initializes. | ||
303 | void matrix_init_user(void) { | ||
304 | |||
305 | }; | ||
306 | |||
307 | // Runs constantly in the background, in a loop. | ||
308 | void matrix_scan_user(void) { | ||
309 | |||
310 | uint8_t layer = biton32(layer_state); | ||
311 | // uint8_t default_layer = biton32(layer_state); | ||
312 | |||
313 | ergodox_board_led_off(); | ||
314 | ergodox_right_led_1_off(); | ||
315 | ergodox_right_led_2_off(); | ||
316 | ergodox_right_led_3_off(); | ||
317 | |||
318 | switch (layer) { | ||
319 | case _CO: | ||
320 | ergodox_right_led_1_on(); | ||
321 | break; | ||
322 | case _QW: | ||
323 | ergodox_right_led_2_on(); | ||
324 | break; | ||
325 | case _NU: | ||
326 | ergodox_right_led_3_on(); | ||
327 | break; | ||
328 | case _GA: | ||
329 | ergodox_right_led_1_on(); | ||
330 | ergodox_right_led_2_on(); | ||
331 | default: | ||
332 | // none | ||
333 | break; | ||
334 | } | ||
335 | |||
336 | }; | ||