aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/community/ergodox/colemak_code_friendly/keymap.c335
-rw-r--r--layouts/community/ergodox/colemak_code_friendly/readme.md106
-rw-r--r--layouts/community/ergodox/colemak_code_friendly/rules.mk7
3 files changed, 448 insertions, 0 deletions
diff --git a/layouts/community/ergodox/colemak_code_friendly/keymap.c b/layouts/community/ergodox/colemak_code_friendly/keymap.c
new file mode 100644
index 000000000..936ddbc2a
--- /dev/null
+++ b/layouts/community/ergodox/colemak_code_friendly/keymap.c
@@ -0,0 +1,335 @@
1/* -*- Mode:C; c-basic-offset:2; tab-width:2; indent-tabs-mode:nil; evil-indent-convert-tabs:t; -*- */
2
3#include QMK_KEYBOARD_H
4
5//#define DYNAMIC_MACRO_SIZE 128
6
7#define LAYER_BASE 0 /* default layer */
8#define LAYER_NUM 1 /* numbers and symbols */
9#define LAYER_LNUM 2 /* Left side -> LAYER_NUM, Right side -> Shift + LAYER_BASE */
10#define LAYER_RNUM 3 /* Left side -> Shift + LAYER_BASE, Right side -> LAYER_NUM */
11
12enum custom_keycodes5 {
13 PLACEHOLDER = SAFE_RANGE, /* can always be here */
14
15 M_POINER, /* -> */
16 M_LAMBDA, /* => */
17 M_IN_CBR, /* {} */
18 M_IN_PRN, /* () */
19 M_IN_BRC, /* [] */
20 M_IN_ANG, /* <> */
21 M_NOT_EQL, /* != */
22 M_COL_EQL, /* := */
23 M_PLUS_EQL,/* += */
24
25 DYNAMIC_MACRO_RANGE,
26};
27
28#include "dynamic_macro.h"
29
30
31
32
33const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
34/* Keymap 0: Basic layer
35 * .--------------------------------------------------. .--------------------------------------------------.
36 * | Grave | ! | @ | # | $ | % | ^ | | TG(1)| & | * | ( | ) | - | Bspc |
37 * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
38 * | Tab | Q | W | F | P | G | = | | _ | J | L | U | Y | ; | \ |
39 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
40 * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' |
41 * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------|
42 * | LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | |K/RAlt| M | , |./Supe|/ RCtl| RShift |
43 * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------'
44 * | LCtl |Super | Alt | [ | ] | | Left | Down | Up |Right | Del |
45 * '----------------------------------' '----------------------------------'
46 * .-------------. .-------------.
47 * | Home | End | | Ins |ScrLck|
48 * .------+------+------| |------+------+------.
49 * | | |PrnScr| | PgUp | | |
50 * | LNUM | Enter|------| |------| Space| RNUM |
51 * | | | Super| | PgDn | | |
52 * '--------------------' '--------------------'
53 */
54
55[LAYER_BASE] = LAYOUT_ergodox( /* layer 0 : default */
56 /* left hand */
57 KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC,
58 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_EQL,
59 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D,
60 KC_LSFT, LCTL_T(KC_Z), LGUI_T(KC_X), KC_C, KC_V, RALT_T(KC_B), KC_LCBR,
61 KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, KC_RBRC,
62
63 KC_HOME, KC_END,
64 KC_PSCR,
65 MO(LAYER_LNUM), KC_ENT, KC_LGUI,
66 /* right hand */
67 TG(1), KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_BSPC,
68 KC_UNDS, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
69 KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
70 KC_RCBR, RALT_T(KC_K), KC_M, KC_COMM, LGUI_T(KC_DOT), RCTL_T(KC_SLSH), KC_RSFT,
71 KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL,
72 KC_INS, KC_SLCK,
73 KC_PGUP,
74 KC_PGDN, KC_SPC, MO(LAYER_RNUM)
75),
76/* Keymap 1: Numbers, Macro Record
77 *
78 * .--------------------------------------------------. .--------------------------------------------------.
79 * | | | | | | <> | | | | | * | ( | ) | - | |
80 * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
81 * | | F12 | F11 | F10 | F9 | {} | | | = | => | 7 | 8 | 9 | + | |
82 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
83 * | | F8 | F7 | F6 | F5 | () |------| |------| -> | 4 | 5 | 6 | 0 | |
84 * |--------+------+------+------+------+------| | | Enter|------+------+------+------+------+--------|
85 * | | F4 | F3 | F2 | F1 | [] | | | | != | 1 | 2 | 3 | | |
86 * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------'
87 * | MUTE | VOLD | VOLU | | | | 0 | , | . | | |
88 * '----------------------------------' '----------------------------------'
89 * .-------------. .-------------.
90 * | | | | | Stop |
91 * .------+------+------| |------+------+------.
92 * | | |Start1| |Start2| | |
93 * | | |------| |------| | |
94 * | | |Play1 | |Play2 | | |
95 * '--------------------' '--------------------'
96 */
97[LAYER_NUM] = LAYOUT_ergodox(
98 /* left hand */
99 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_IN_ANG, KC_TRNS,
100 KC_TRNS, KC_F12, KC_F11, KC_F10, KC_F9, M_IN_CBR, KC_TRNS,
101 KC_TRNS, KC_F8, KC_F7, KC_F6, KC_F5, M_IN_PRN,
102 KC_TRNS, KC_F4, KC_F3, KC_F2, KC_F1, M_IN_BRC, KC_TRNS,
103 KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS,
104
105 KC_TRNS, KC_TRNS,
106 DYN_REC_START1,
107 KC_TRNS, KC_TRNS, DYN_MACRO_PLAY1,
108 /* right hand */
109 KC_TRNS, KC_TRNS, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_TRNS,
110 KC_EQL, M_LAMBDA, KC_7, KC_8, KC_9, KC_PLUS, KC_TRNS,
111 M_POINER, KC_4, KC_5, KC_6, KC_0, KC_TRNS,
112 KC_ENT, M_NOT_EQL, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS,
113 KC_0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS,
114 KC_TRNS, DYN_REC_STOP,
115 DYN_REC_START2,
116 DYN_MACRO_PLAY2, KC_TRNS, KC_TRNS
117),
118/* Keymap 2: Left side -> LAYER_NUM, Right side -> Shift + LAYER_BASE
119 *
120 * .--------------------------------------------------. .--------------------------------------------------.
121 * | | | | | | <> | | | TG(1)| & | * | ( | ) | - | Bspc |
122 * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
123 * | | F12 | F11 | F10 | F9 | {} | | | _ | J | L | U | Y | ; | \ |
124 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
125 * | | F8 | F7 | F6 | F5 | () |------| |------| H | N | E | I | O | ' |
126 * |--------+------+------+------+------+------| | | } |------+------+------+------+------+--------|
127 * | | F4 | F3 | F2 | F1 | [] | | | |K/RAlt| M | , |./Supe|/ RCtl| RShift |
128 * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------'
129 * | MUTE | VOLD | VOLU | | | | Left | Down | Up |Right | Del |
130 * '----------------------------------' '----------------------------------'
131 * .-------------. .-------------.
132 * | | | | Ins |ScrLck|
133 * .------+------+------| |------+------+------.
134 * | | |Start1| | PgUp | | |
135 * | | |------| |------| Space|CapsLk|
136 * | | |Play1 | | PgDn | | |
137 * '--------------------' '--------------------'
138 */
139[LAYER_LNUM] = LAYOUT_ergodox(
140 /* left hand */
141 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_IN_ANG, KC_TRNS,
142 KC_TRNS, KC_F12, KC_F11, KC_F10, KC_F9, M_IN_CBR, KC_TRNS,
143 KC_TRNS, KC_F8, KC_F7, KC_F6, KC_F5, M_IN_PRN,
144 KC_TRNS, KC_F4, KC_F3, KC_F2, KC_F1, M_IN_BRC, KC_TRNS,
145 KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS,
146
147 KC_TRNS, KC_TRNS,
148 DYN_REC_START1,
149 KC_TRNS, KC_TRNS, DYN_MACRO_PLAY1,
150 /* right hand */
151 TG(1), KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, S(KC_MINS), S(KC_BSPC),
152 KC_UNDS, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), S(KC_SCLN), S(KC_BSLS),
153 S(KC_H), S(KC_N), S(KC_E), S(KC_I), S(KC_O), S(KC_QUOT),
154 KC_RCBR, S(KC_K), S(KC_M), S(KC_COMM), S(KC_DOT), S(KC_SLSH), KC_RSFT,
155 S(KC_LEFT), S(KC_DOWN), S(KC_UP), S(KC_RGHT), S(KC_DEL),
156 S(KC_INS), S(KC_SLCK),
157 S(KC_PGUP),
158 S(KC_PGDN), S(KC_SPC), KC_CAPS
159),
160/* Keymap 3: Left side -> Shift + LAYER_BASE, Right side -> LAYER_NUM
161 *
162 * .--------------------------------------------------. .--------------------------------------------------.
163 * | Grave | ! | @ | # | $ | % | ^ | | | | * | ( | ) | - | |
164 * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
165 * | Tab | Q | W | F | P | G | = | | = | => | 7 | 8 | 9 | + | |
166 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
167 * | Esc | A | R | S | T | D |------| |------| -> | 4 | 5 | 6 | 0 | |
168 * |--------+------+------+------+------+------| { | | Enter|------+------+------+------+------+--------|
169 * | LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | | != | 1 | 2 | 3 | | |
170 * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------'
171 * | LCtl |Super | Alt | [ | ] | | 0 | , | . | | |
172 * '----------------------------------' '----------------------------------'
173 * .-------------. .-------------.
174 * | Home | End | | | Stop |
175 * .------+------+------| |------+------+------.
176 * | | |PrnScr| |Start2| | |
177 * |CapsLk| Enter|------| |------| | |
178 * | | | Super| |Play2 | | |
179 * '--------------------' '--------------------'
180 */
181[LAYER_RNUM] = LAYOUT_ergodox(
182 /* left hand */
183 S(KC_GRV), KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC,
184 S(KC_TAB), S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_G), S(KC_EQL),
185 S(KC_ESC), S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_D),
186 KC_LSFT, S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), KC_LCBR,
187 S(KC_LCTL), S(KC_LGUI), S(KC_LALT), S(KC_LBRC), S(KC_RBRC),
188
189 S(KC_HOME), S(KC_END),
190 S(KC_PSCR),
191 KC_CAPS, S(KC_ENT), S(KC_LGUI),
192 /* right hand */
193 KC_TRNS, KC_TRNS, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_TRNS,
194 KC_EQL, M_LAMBDA, KC_7, KC_8, KC_9, KC_PLUS, KC_TRNS,
195 M_POINER, KC_4, KC_5, KC_6, KC_0, KC_TRNS,
196 KC_ENT, M_NOT_EQL, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS,
197 KC_0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS,
198 KC_TRNS, DYN_REC_STOP,
199 DYN_REC_START2,
200 DYN_MACRO_PLAY2, KC_TRNS, KC_TRNS
201),
202};
203
204static bool recording_dynamic_macro;
205
206static bool process_record_dynamic_macro_wrapper(uint16_t keycode, keyrecord_t *record) {
207 switch (keycode) {
208 /* detect dynamic macro recording state */
209 case DYN_REC_START1:
210 case DYN_REC_START2:
211 if (record->event.pressed) {
212 recording_dynamic_macro = true;
213 }
214 break;
215 case DYN_REC_STOP:
216 if (record->event.pressed) {
217 recording_dynamic_macro = false;
218 }
219 break;
220 }
221
222 if (!process_record_dynamic_macro(keycode, record)) {
223 return false;
224 }
225
226 return true;
227}
228
229bool process_record_user(uint16_t keycode, keyrecord_t *record) {
230
231 /* the purpose of the ..._wrapper is to detect START/ST0P keys to
232 light the blue led during recording */
233 if (!process_record_dynamic_macro_wrapper(keycode, record)) {
234 return false;
235 }
236
237 switch (keycode) {
238 /* static macro keys */
239 case M_IN_CBR:
240 if (record->event.pressed) {
241 SEND_STRING("{}" SS_TAP(X_LEFT));
242 return false;
243 }
244 break;
245 case M_IN_PRN:
246 if (record->event.pressed) {
247 SEND_STRING("()" SS_TAP(X_LEFT));
248 return false;
249 }
250 break;
251 case M_IN_BRC:
252 if (record->event.pressed) {
253 SEND_STRING("[]" SS_TAP(X_LEFT));
254 return false;
255 }
256 break;
257 case M_IN_ANG:
258 if (record->event.pressed) {
259 SEND_STRING("<>" SS_TAP(X_LEFT));
260 return false;
261 }
262 break;
263 case M_POINER:
264 if (record->event.pressed) {
265 SEND_STRING("->");
266 return false;
267 }
268 break;
269 case M_LAMBDA:
270 if (record->event.pressed) {
271 SEND_STRING("=>");
272 return false;
273 }
274 break;
275 case M_NOT_EQL:
276 if (record->event.pressed) {
277 SEND_STRING("!=");
278 return false;
279 }
280 break;
281 case M_COL_EQL:
282 if (record->event.pressed) {
283 SEND_STRING(":=");
284 return false;
285 }
286 break;
287 case M_PLUS_EQL:
288 if (record->event.pressed) {
289 SEND_STRING("+=");
290 return false;
291 }
292 break;
293 }
294
295 return true;
296}
297
298/* Runs just one time when the keyboard initializes. */
299void matrix_init_user(void) {
300 ergodox_board_led_off();
301 ergodox_right_led_1_off();
302 ergodox_right_led_2_off();
303 ergodox_right_led_3_off();
304 ergodox_right_led_1_set(5);
305 ergodox_right_led_2_set(5);
306 ergodox_right_led_3_set(5);
307};
308
309/* Runs constantly in the background, in a loop. */
310void matrix_scan_user(void) {
311 uint8_t layer = biton32(layer_state);
312
313 //led 1, RED, Caps-Lock ON
314 //if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ergodox_right_led_1_on();
315
316 //led 2, GREEN
317 if (layer == LAYER_NUM)
318 ergodox_right_led_2_on();
319 else
320 ergodox_right_led_2_off();
321
322 //led 3, BLUE
323 if (recording_dynamic_macro)
324 ergodox_right_led_3_on();
325 else
326 ergodox_right_led_3_off();
327};
328
329// Runs constantly in the background, in a loop.
330void led_set_user(uint8_t usb_led) {
331 if (usb_led & (1<<USB_LED_CAPS_LOCK))
332 ergodox_right_led_1_on();
333 else
334 ergodox_right_led_1_off();
335}
diff --git a/layouts/community/ergodox/colemak_code_friendly/readme.md b/layouts/community/ergodox/colemak_code_friendly/readme.md
new file mode 100644
index 000000000..1135d153a
--- /dev/null
+++ b/layouts/community/ergodox/colemak_code_friendly/readme.md
@@ -0,0 +1,106 @@
1# ErgoDox EZ Code Friendly Colemak Layout
2
3 _This layout was inspired by qwerty_code_friendly layout._
4
5 Having all the symbols accessible without modifiers is a good improvement for coding.
6
7 There are only two layouts which is easy to memorize.
8
9 There are two _"Super shifts"_, LNUM and RNUM, placed on the most convenient physical keys. Each of them act as shift for the opposite side of the keyboard, and as a modifier key for the current side (usage similar to AltGr in many national layouts). This is achieved by duplicating the corresponding parts of Layer 0 and 1 into Layer 3 and 4. As a bonus, pressing both keys toggles Caps-Lock.
10
11 The numerical keypad is composed from regular number keys, works even in macOS.
12
13## Keymap 0: Basic layer
14
15```
16.--------------------------------------------------. .--------------------------------------------------.
17| Grave | ! | @ | # | $ | % | ^ | | TG(1)| & | * | ( | ) | - | Bspc |
18|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
19| Tab | Q | W | F | P | G | = | | _ | J | L | U | Y | ; | \ |
20|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
21| Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' |
22|--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------|
23| LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | |K/RAlt| M | , |./Supe|/ RCtl| RShift |
24'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------'
25 | LCtl |Super | Alt | [ | ] | | Left | Down | Up |Right | Del |
26 '----------------------------------' '----------------------------------'
27 .-------------. .-------------.
28 | Home | End | | Ins |ScrLck|
29 .------+------+------| |------+------+------.
30 | | |PrnScr| | PgUp | | |
31 | LNUM | Enter|------| |------| Space| RNUM |
32 | | | Super| | PgDn | | |
33 '--------------------' '--------------------'
34```
35
36## Keymap 1: Numbers, Macro Record
37
38
39```
40.--------------------------------------------------. .--------------------------------------------------.
41| | | | | | <> | | | | | * | ( | ) | - | |
42|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
43| | F12 | F11 | F10 | F9 | {} | | | = | => | 7 | 8 | 9 | + | |
44|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
45| | F8 | F7 | F6 | F5 | () |------| |------| -> | 4 | 5 | 6 | 0 | |
46|--------+------+------+------+------+------| | | Enter|------+------+------+------+------+--------|
47| | F4 | F3 | F2 | F1 | [] | | | | != | 1 | 2 | 3 | | |
48'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------'
49 | MUTE | VOLD | VOLU | | | | 0 | , | . | | |
50 '----------------------------------' '----------------------------------'
51 .-------------. .-------------.
52 | | | | | Stop |
53 .------+------+------| |------+------+------.
54 | | |Start1| |Start2| | |
55 | | |------| |------| | |
56 | | |Play1 | |Play2 | | |
57 '--------------------' '--------------------'
58```
59
60## Keymap 2: Left side -> LAYER_NUM, Right side -> Shift + LAYER_BASE
61
62
63```
64.--------------------------------------------------. .--------------------------------------------------.
65| | | | | | <> | | | TG(1)| & | * | ( | ) | - | Bspc |
66|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
67| | F12 | F11 | F10 | F9 | {} | | | _ | J | L | U | Y | ; | \ |
68|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
69| | F8 | F7 | F6 | F5 | () |------| |------| H | N | E | I | O | ' |
70|--------+------+------+------+------+------| | | } |------+------+------+------+------+--------|
71| | F4 | F3 | F2 | F1 | [] | | | |K/RAlt| M | , |./Supe|/ RCtl| RShift |
72'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------'
73 | MUTE | VOLD | VOLU | | | | Left | Down | Up |Right | Del |
74 '----------------------------------' '----------------------------------'
75 .-------------. .-------------.
76 | | | | Ins |ScrLck|
77 .------+------+------| |------+------+------.
78 | | |Start1| | PgUp | | |
79 | | |------| |------| Space|CapsLk|
80 | | |Play1 | | PgDn | | |
81 '--------------------' '--------------------'
82```
83
84## Keymap 3: Left side -> Shift + LAYER_BASE, Right side -> LAYER_NUM
85
86
87```
88.--------------------------------------------------. .--------------------------------------------------.
89| Grave | ! | @ | # | $ | % | ^ | | | | * | ( | ) | - | |
90|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
91| Tab | Q | W | F | P | G | = | | = | => | 7 | 8 | 9 | + | |
92|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
93| Esc | A | R | S | T | D |------| |------| -> | 4 | 5 | 6 | 0 | |
94|--------+------+------+------+------+------| { | | Enter|------+------+------+------+------+--------|
95| LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | | != | 1 | 2 | 3 | | |
96'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------'
97 | LCtl |Super | Alt | [ | ] | | 0 | , | . | | |
98 '----------------------------------' '----------------------------------'
99 .-------------. .-------------.
100 | Home | End | | | Stop |
101 .------+------+------| |------+------+------.
102 | | |PrnScr| |Start2| | |
103 |CapsLk| Enter|------| |------| | |
104 | | | Super| |Play2 | | |
105 '--------------------' '--------------------'
106```
diff --git a/layouts/community/ergodox/colemak_code_friendly/rules.mk b/layouts/community/ergodox/colemak_code_friendly/rules.mk
new file mode 100644
index 000000000..2bff0c5cf
--- /dev/null
+++ b/layouts/community/ergodox/colemak_code_friendly/rules.mk
@@ -0,0 +1,7 @@
1COMMAND_ENABLE = no
2BOOTMAGIC_ENABLE = no
3MOUSEKEY_ENABLE = no
4CONSOLE_ENABLE = no
5RGBLIGHT_ENABLE = no
6LEADER_ENABLE = no
7MIDI_ENABLE = no