aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/community/ergodox/bocaj/config.h2
-rw-r--r--layouts/community/ergodox/bocaj/keymap.c307
-rw-r--r--layouts/community/ergodox/bocaj/readme.md47
-rw-r--r--layouts/community/ergodox/bocaj/rules.mk23
-rw-r--r--layouts/community/ortho_4x12/bocaj/config.h109
-rw-r--r--layouts/community/ortho_4x12/bocaj/keymap.c286
-rw-r--r--layouts/community/ortho_4x12/bocaj/readme.md23
-rw-r--r--layouts/community/ortho_4x12/bocaj/rules.mk44
-rw-r--r--users/bocaj/.gitignore1
-rw-r--r--users/bocaj/.gitlab-ci.yml24
-rw-r--r--users/bocaj/bocaj.c285
-rw-r--r--users/bocaj/bocaj.h96
-rw-r--r--users/bocaj/config.h124
-rw-r--r--users/bocaj/process_records.c240
-rw-r--r--users/bocaj/process_records.h62
-rw-r--r--users/bocaj/readme.md101
-rw-r--r--users/bocaj/rgb_matrix_stuff.c106
-rw-r--r--users/bocaj/rgb_matrix_stuff.h10
-rw-r--r--users/bocaj/rules.mk43
-rw-r--r--users/bocaj/send_unicode.c106
-rw-r--r--users/bocaj/send_unicode.h71
-rw-r--r--users/bocaj/tap_dances.c64
-rw-r--r--users/bocaj/tap_dances.h19
-rw-r--r--users/bocaj/wrappers.h202
24 files changed, 1403 insertions, 992 deletions
diff --git a/layouts/community/ergodox/bocaj/config.h b/layouts/community/ergodox/bocaj/config.h
index bc1d20a62..621ae784c 100644
--- a/layouts/community/ergodox/bocaj/config.h
+++ b/layouts/community/ergodox/bocaj/config.h
@@ -1,6 +1,4 @@
1#pragma once 1#pragma once
2 2
3#include QMK_KEYBOARD_CONFIG_H
4
5#define LEADER_TIMEOUT 250 3#define LEADER_TIMEOUT 250
6#define LEADER_PER_KEY_TIMING 4#define LEADER_PER_KEY_TIMING
diff --git a/layouts/community/ergodox/bocaj/keymap.c b/layouts/community/ergodox/bocaj/keymap.c
index cb78e7aae..ba105a8f1 100644
--- a/layouts/community/ergodox/bocaj/keymap.c
+++ b/layouts/community/ergodox/bocaj/keymap.c
@@ -1,5 +1,5 @@
1/* 1/*
2Copyright 2018 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell 2Copyright 2020 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell
3 3
4This program is free software: you can redistribute it and/or modify 4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 5it under the terms of the GNU General Public License as published by
@@ -15,182 +15,161 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#include QMK_KEYBOARD_H
19#include "bocaj.h" 18#include "bocaj.h"
20 19
21#define LAYOUT_ergodox_pretty_base( \ 20/*
22 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ 21 * The `LAYOUT_ergodox_pretty_base` macro is a template to allow the use of
23 K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ 22 * identical modifiers for the default layouts (eg QWERTY, Colemak, Dvorak,
24 K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ 23 * etc), so that there is no need to set them up for each layout, and modify
25 ) \ 24 * all of them if I want to change them. This helps to keep consistency and
26 LAYOUT_ergodox_pretty_wrapper( \ 25 * ease of use. K## is a placeholder to pass through the individual keycodes
27 KC_ESC, __________________NUMBER_LEFT_______________, JJ_ARRW, KC_MINS, __________________NUMBER_RIGHT______________, KC_EQUAL, \ 26 */
28 KC_DEL, K01, K02, K03, K04, K05, KC_LPRN, KC_RPRN, K06, K07, K08, K09, K0A, KC_BSLASH, \ 27#define LAYOUT_ergodox_bocaj(...) WRAPPER_ergodox_bocaj(__VA_ARGS__)
29 KC_NUMS, K11, SFT_T(K12), K13, ALT_T(K14), K15, K16, ALT_T(K17), K18, SFT_T(K19), K1A, KC_QUOT, \ 28#define LAYOUT_ergodox_bocaj_WIN(...) WRAPPER_ergodox_bocaj_WIN(__VA_ARGS__)
30 OS_LSFT, CTL_T(K21), K22, K23, K24, K25, HYP_LBK, MEH_RBK, K26, K27, K28, K29, CTL_T(K2A), KC_RSFT, \
31 KC_GAME,KC_NUMS, TT(_LOWER), KC_UP, KC_LEFT, KC_RIGHT, KC_DOWN, UC_DISA,KC_GAME, KC_ADJS, \
32 KC_APP,KC_HOME, KC_END,KC_ESC, \
33 UC_FLIP, UC_TABL, \
34 KC_SPACE,KC_BSPACE,KC_LEAD, UC_SHRG,KC_TAB,KC_LWEN \
35)
36
37#define LAYOUT_ergodox_pretty_base_wrapper(...) LAYOUT_ergodox_pretty_base(__VA_ARGS__)
38 29
39const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
40 /* Workman - http://www.keyboard-layout-editor.com/#/gists/7a07cb982ec3597ba3e3d947554225f1 31
41 .---------------------------------------------. .---------------------------------------------. 32 [_WORKMAN] = LAYOUT_ergodox_bocaj(
42 | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | 33 KC_ESC, ________________NUMBER_LEFT________________, KC_ARRW, KC_MINS, ________________NUMBER_RIGHT_______________, KC_EQUAL,
43 !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! 34 KC_DEL, _________________WORKMAN_L1________________, KC_LPRN, KC_RPRN, _________________WORKMAN_R1________________, KC_BSLS,
44 | DEL | Q | D | R | W | B | ( | ! ) | J | F | U | P | ; | \ | 35 _______, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
45 !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! 36 KC_LSFT, _________________WORKMAN_L3________________, KC_LBRC, KC_RBRC, _________________WORKMAN_R3________________, _______,
46 | NUMS | A | S | H | T | G |-------! !-------! Y | N | E | O | I | ' | 37 MO_MOD, KC_PGUP, KC_HOME, KC_UP, KC_LEFT, KC_RIGHT, KC_DOWN, KC_END, KC_PGDN, WORKMAN,
47 !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! 38 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
48 | SHIFT | Z | X | M | C | V | [ | ! ] | K | L | , | . | / | SHIFT | 39 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
49 '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' 40 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
50 | | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | |GAME | ADJ | 41 ),
51 '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' 42
52 .-------+-------+-------! !-------+-------+-------. 43 [_WWORKMAN] = LAYOUT_ergodox_bocaj_WIN(
53 ! ! | END | ! PGDN | ! ENTER ! 44 KC_ESC, ________________NUMBER_LEFT________________, KC_ARRW, KC_MINS, ________________NUMBER_RIGHT_______________, KC_EQUAL,
54 ! SPACE ! BSPCE !-------! !-------! TAB ! / ! 45 KC_DEL, _________________WORKMAN_L1________________, KC_LPRN, KC_RPRN, _________________WORKMAN_R1________________, KC_BSLS,
55 | | | COPY | ! PASTE | | LOWER | 46 _______, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
56 '-----------------------' '-----------------------' 47 KC_LSFT, _________________WORKMAN_L3________________, KC_LBRC, KC_RBRC, _________________WORKMAN_R3________________, _______,
57*/ 48 MO_MOD, KC_PGUP, KC_HOME, KC_UP, KC_LEFT, KC_RIGHT, KC_DOWN, KC_END, KC_PGDN, WORKMAN,
58 [_WORKMAN] = LAYOUT_ergodox_pretty_base_wrapper( 49 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
59 _________________WORKMAN_L1_________________, _________________WORKMAN_R1_________________, 50 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
60 _________________WORKMAN_L2_________________, _________________WORKMAN_R2_________________, 51 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
61 _________________WORKMAN_L3_________________, _________________WORKMAN_R3_________________ 52 ),
62 ), 53
63 [_WINWORKMAN] = LAYOUT_ergodox_pretty_base_wrapper( 54 [_LOWER] = LAYOUT_ergodox_bocaj(
64 _________________WORKMAN_L1_________________, _________________WORKMAN_R1_________________, 55 KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
65 ________________WWORKMAN_L2_________________, ________________WWORKMAN_R2_________________, 56 _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_BSLS, _______,
66 _________________WORKMAN_L3_________________, _________________WORKMAN_R3_________________ 57 _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_4, KC_5, KC_6, KC_ASTR, _______,
67 ), 58 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_PLUS, _______,
68/* QWERTY - http://www.keyboard-layout-editor.com/#/gists/b6c016a22a9d31381a276a603a42fe5f 59 _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_COMM, KC_MINS, _______,
69 .---------------------------------------------. .---------------------------------------------. 60 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
70 | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | 61 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
71 !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! 62 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
72 | DEL | Q | W | E | R | T | ( | ! ) | Y | U | I | O | P | \ | 63 ),
73 !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! 64
74 | NUMS | A | S | D | F | G |-------! !-------! H | J | K | L | ; | ' | 65 [_RAISE] = LAYOUT_ergodox_bocaj(
75 !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! 66 KC_TILD, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, _______,
76 | SHIFT | Z | X | C | V | B | [ | ! ] | N | M | , | . | / | SHIFT | 67 KC_F11, _________________RAISE_L2__________________, _______, _______, _________________RAISE_R2__________________, KC_F12,
77 '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' 68 _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
78 | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | 69 _______, _______, KC_MRWD, KC_MPLY, KC_MFFD, _______, _______, _______, ___________________BLANK___________________, _______,
79 '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' 70 ___________________BLANK___________________, ___________________BLANK___________________,
80 .-------+-------+-------! !-------+-------+-------. 71 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
81 ! ! | END | ! PGDN | ! ENTER ! 72 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
82 ! SPACE ! BSPCE !-------! !-------! TAB ! / ! 73 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
83 | | | COPY | ! PASTE | | LOWER | 74 ),
84 '-----------------------' '-----------------------' 75
85*/ 76 [_ADJUST] = LAYOUT_ergodox_pretty(
86 [_QWERTY] = LAYOUT_ergodox_pretty_base_wrapper( 77 KC_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RST,
87 _________________QWERTY_L1__________________, _________________QWERTY_R1__________________, 78 VRSN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST,
88 _________________QWERTY_L2__________________, _________________QWERTY_R2__________________, 79 _______, KC__MUTE, KC__VOLDOWN, KC__VOLUP, _______, KC_MNXT, _______, _______, _______, _______, _______, _______,
89 _________________QWERTY_L3__________________, _________________QWERTY_R3__________________ 80 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
90 ), 81 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
91 [_LOWER] = LAYOUT_ergodox_pretty_wrapper( 82 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
92 KC_F11 ,__________________FUNCTION_LEFT_____________, _______, _______, __________________FUNCTION_RIGHT____________, KC_F12, 83 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
93 _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_PAST, _______, 84 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
94 LM_GRAVE, _______, KC_LEFT, KC_DOWN,KC_RIGHT, _______, _______, KC_4, KC_5, KC_6, KC_PPLS, _______, 85 ),
95 OS_LSFT,____________________BLANK___________________, _______, _______, _______, KC_1, KC_2, KC_3, KC_PMNS, _______, 86
96 ____________________BLANK___________________, KC_0, KC_PDOT, KC_COMM,KC_PEQL, _______, 87 // Wrapping Mouse-Wheel Keys with `X_T()` style functions seems
97 _______, _______, _______, _______, 88 // to break the mouse button. So we can't use the wrapper here.
98 _______, _______, 89 [_MOD] = LAYOUT_ergodox_pretty(
99 _______, _______, _______, _______, _______, _______ 90 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
100 ), 91 _______, _______, _______, KC_WH_D, _______, _______, _______, _______, _______, _______, KC_MS_U, _______, _______, _______,
101/* Adjust - http://www.keyboard-layout-editor.com/#/gists/dedeae17b35a5d5f745a42aaea78f007 92 _______, _______, KC_WH_L, KC_WH_U, KC_WH_R, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______,
102 .---------------------------------------------. .---------------------------------------------. 93 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
103 | MAKE | | | | | | RESET | ! EPRM | | | | | | | 94 _______, _______, _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______,
104 !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! 95 _______,_______, /* <- LHS/RHS -> */ _______,_______,
105 | | | | | | | | ! | | | | | | | 96 _______, /* <- LHS/RHS -> */ _______,
106 !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! 97 KC_BTN1,KC_BTN2,_______, /* <- LHS/RHS -> */ _______,KC_BTN3,KC_BTN4
107 | | 🔇 | 🔉 | 🔊 | LCK | |-------! !-------! | | | | | QWRTY | 98 )
108 !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! 99
109 | | | | | | | | ! | | | | | WIN | WRKMN |
110 '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
111 | | | | | | .---------------. .---------------. ! | | | | |
112 '------------------------------' | | | ! | | '------------------------------'
113 .-------+-------+-------! !-------+-------+-------.
114 ! ! | | ! | ! !
115 ! ! !-------! !-------! ! !
116 | | | | ! | | |
117 '-----------------------' '-----------------------'
118*/
119 [_ADJUST] = LAYOUT_ergodox_pretty_wrapper(
120 KC_MAKE, ____________________BLANK___________________, KC_RST, KC_EPRM, ____________________BLANK___________________, XXXXXXX,
121 _______, ____________________BLANK___________________, _______, _______, ____________________BLANK___________________, XXXXXXX,
122 _______,KC__MUTE,KC__VOLDOWN,KC__VOLUP,MC_LOCK,_______, ____________________BLANK___________________, KC_MQWR,
123 _______, ____________________BLANK___________________, _______, _______, _______, _______, _______, _______, KC_WWRK, KC_MWRK,
124 ____________________BLANK___________________, ____________________BLANK___________________,
125 _______, _______, _______, _______,
126 _______, _______,
127 _______, _______, _______, _______, _______, _______
128 ),
129 [_DIABLO] = LAYOUT_ergodox_pretty_wrapper(
130 KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO,
131 KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_ENTER, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
132 KC_Q, KC_1, KC_2, KC_3, KC_4, KC_P, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
133 KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, KC_LOCK, KC_NO, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO,
134 _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO,
135 KC_L, KC_J, KC_NO, KC_NO,
136 KC_F, KC_NO,
137 SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DCLR, KC_PGDN, KC_DEL, KC_ENT
138 )
139}; 100};
101// clang-format on
140 102
141bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { 103bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
142 return true; 104 return true;
143} 105}
144 106
145void matrix_init_keymap(void) {}; 107void matrix_init_keymap(void) {};
146 108
109// Runs whenever there is a layer state change.
110layer_state_t layer_state_set_keymap(layer_state_t state) {
111 ergodox_board_led_off();
112 ergodox_right_led_1_off();
113 ergodox_right_led_2_off();
114 ergodox_right_led_3_off();
115
116 uint8_t layer = get_highest_layer(state);
117 switch (layer) {
118 case _LOWER:
119 ergodox_right_led_3_on();
120 break;
121 case _MOD:
122 ergodox_right_led_2_on();
123 break;
124 case _RAISE:
125 ergodox_right_led_1_on();
126 break;
127 case _ADJUST:
128 ergodox_right_led_1_on();
129 ergodox_right_led_2_on();
130 break;
131 default:
132 break;
133 }
134
135 ergodox_right_led_1_set(25);
136 ergodox_right_led_2_set(25);
137 ergodox_right_led_3_set(25);
138
139 return state;
140};
141
147void matrix_scan_keymap(void) { 142void matrix_scan_keymap(void) {
148 uint8_t modifiers = get_mods(); 143 uint8_t modifiers = get_mods();
149 uint8_t led_usb_state = host_keyboard_leds(); 144 uint8_t led_usb_state = host_keyboard_leds();
150 uint8_t one_shot = get_oneshot_mods(); 145 uint8_t one_shot = get_oneshot_mods();
151 uint8_t layer = biton32(layer_state); 146 uint8_t layer_is_workman = layer_state_is(_WORKMAN);
152 147
153 ergodox_board_led_off(); 148 if ((modifiers) && (layer_is_workman)) {
154 ergodox_right_led_1_off(); 149 if (modifiers & MODS_SHIFT_MASK || led_usb_state & (1<<USB_LED_CAPS_LOCK) || one_shot & MODS_SHIFT_MASK) {
155 ergodox_right_led_2_off(); 150 ergodox_right_led_1_on();
156 ergodox_right_led_3_off(); 151 ergodox_right_led_1_set( 25 );
157 152 } else {
158 switch (layer) { 153 ergodox_right_led_1_off();
159 case _WORKMAN: 154 }
160 case _QWERTY:
161 case _WINWORKMAN:
162 if (modifiers & MODS_SHIFT_MASK || led_usb_state & (1<<USB_LED_CAPS_LOCK) || one_shot & MODS_SHIFT_MASK) {
163 ergodox_right_led_1_on();
164 ergodox_right_led_1_set( 25 );
165 }
166 if (modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK || modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK) {
167 if ((modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) && (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK)) { 155 if ((modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) && (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK)) {
168 ergodox_right_led_2_on(); 156 ergodox_right_led_2_on();
169 ergodox_right_led_2_set( 50 ); 157 ergodox_right_led_2_set( 50 );
158 } else if ((modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) || (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK)) {
159 ergodox_right_led_2_on();
160 ergodox_right_led_2_set( 10 );
161 } else {
162 ergodox_right_led_2_off();
163 }
164 if (modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) {
165 ergodox_right_led_3_on();
166 ergodox_right_led_3_set( 10 );
170 } else { 167 } else {
171 ergodox_right_led_2_on(); 168 ergodox_right_led_3_off();
172 ergodox_right_led_2_set( 10 );
173 } 169 }
174 } 170 } else if (!(modifiers) && (layer_is_workman)) {
175 if (modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) { 171 ergodox_right_led_1_off();
176 ergodox_right_led_3_on(); 172 ergodox_right_led_2_off();
177 ergodox_right_led_3_set( 10 ); 173 ergodox_right_led_3_off();
178 } 174 }
179 break;
180 case _LOWER:
181 ergodox_right_led_3_on();
182 ergodox_right_led_3_set(10); // Default brightness is deadly in a dark room
183 break;
184 case _ADJUST:
185 ergodox_right_led_2_on();
186 ergodox_right_led_2_set(10);
187 break;
188 case _DIABLO:
189 ergodox_right_led_1_on();
190 ergodox_right_led_1_set(10);
191 break;
192 default:
193 // none
194 break;
195 }
196}; 175};
diff --git a/layouts/community/ergodox/bocaj/readme.md b/layouts/community/ergodox/bocaj/readme.md
index 901822722..f8bce4e57 100644
--- a/layouts/community/ergodox/bocaj/readme.md
+++ b/layouts/community/ergodox/bocaj/readme.md
@@ -1,37 +1,28 @@
1# Bocaj Layout 1# Overview
2 2
3While I've put my own spin on most things, much of the credit for these ideas belongs to Drashna and/or the people he derived things from. Please see his [layout](../drashna/) and [userspace](../../../../users/drashna/) for lots of ideas and inspiration. 3This is my personal Ergodox EZ configuration, and my daily driver.
4 4
5## Layers Overview 5Most of the code resides in my userspace and is heavily based upon [Drashna's work](https://github.com/qmk/qmk_firmware/tree/master/users/drashna)... although considerably slimmed down.
6 6
7* Default 7## How to build
8 * Workman
9 * Qwerty
10 * Windows Workman (swaps GUI and CTRL buttons)
11* Lower
12 * F1-12 Top Row
13 * Grave / Layer Switch macro at Caps Lock position
14 * Navigation at QWERTY 'ESDF' position
15 * Numpad under right hand
16* Adjust
17 * Volume Control
18 * Mac Lock Macro
19 * Make / Reset/ EEPROM keys
20 * Default Layer changing keys
21 * Diablo Layer
22 * Moved shortcuts within left hands reach
23 * Macros to spam 1-4 every ~1 second
24 * Shift in thumb cluster to prevent pinky fatique
25 8
26## LEDs Overview 9Put simply:
10`make ergodox_ez:bocaj`
27 11
28* Used for _LOWER, _ADJUST, and _DIABLO layer indication 12On that note, I use a separate workspace when making changes to my layouts or userspace. In that repo, there is a tool that does this for me. See [JacobJerrell/qmk_layouts/tools/](https://github.com/JacobJerrell/qmk_layouts/tree/master/tools)
29* Used for Ctrl/GUI, Shift, and Alt indication when on a default layer
30 13
31## Wrappers Overview 14## Layers
32 15
33While it isn't a novel idea, I feel the need to mention it because it really appeals to me as a person that doesn't like repetitive code. 16* WORKMAN: No one uses this board but me and I've never had a reason to switch to QWERTY
17* LOWER:
18 * Left: Grave and navigation arrows
19 * Right: Numpad
20* RAISE:
21 * Symbols across the top, F-Keys on the second row
22* ADJUST
23 * Audio control, make/reset/version macros
24* MOD: mouse navigation
34 25
35We've all come to know and love the pretty wrapper for Ergodox because it makes for such a beautiful, self-documenting keymap. In this keymap, we are building ontop of the pretty wrapper to wrap our default layers with our keys that aren't unique to the layer. 26## Ergodox Specifics
36 27
37Now you can wrap your keymap with `LAYOUT_ergodox_pretty_base_wrapper()` and only feed it the alpha keys, having the top, side, bottom, and thumb clusters automatically filled in. If you make a key to any of the top, side, bottom, or thumb cluster keys, it will propegate to all layers that have this wrapper, or have KC_TRNS keycodes in the same location 28I don't have the underglow or backlit versions so the 3 LEDs on the right board are used for layer indication if not on the base layer. If you're on the base layer, they're used for mod-key indicators.
diff --git a/layouts/community/ergodox/bocaj/rules.mk b/layouts/community/ergodox/bocaj/rules.mk
index aa67ad9e2..88eaf39f8 100644
--- a/layouts/community/ergodox/bocaj/rules.mk
+++ b/layouts/community/ergodox/bocaj/rules.mk
@@ -1,11 +1,14 @@
1AUTO_SHIFT_ENABLE = no 1BOOTMAGIC_ENABLE = yes
2COMMAND_ENABLE = no 2TAP_DANCE_ENABLE = no
3SWAP_HANDS_ENABLE = no 3COMMAND_ENABLE = no # Commands for debug and configuration
4TAP_DANCE_ENABLE = yes 4CONSOLE_ENABLE = yes
5EXTRAKEY_ENABLE = no 5SPACE_CADET_ENABLE = no
6KEY_LOCK_ENABLE = yes 6KEY_LOCK_ENABLE = yes
7LEADER_ENABLE = yes 7MOUSEKEY_ENABLE = yes
8EXTRAKEY_ENABLE = yes
9LEADER_ENABLE = yes
8 10
9UNICODE_ENABLE = yes 11UNICODE_ENABLE = no
10UNICODEMAP_ENABLE = no 12UNICODEMAP_ENABLE = no
11UCIS_ENABLE = no 13RGB_MATRIX_ENABLE = no
14RGBLIGHT_ENABLE = no
diff --git a/layouts/community/ortho_4x12/bocaj/config.h b/layouts/community/ortho_4x12/bocaj/config.h
new file mode 100644
index 000000000..2f5b73198
--- /dev/null
+++ b/layouts/community/ortho_4x12/bocaj/config.h
@@ -0,0 +1,109 @@
1#pragma once
2
3#define LEADER_TIMEOUT 250
4#define LEADER_PER_KEY_TIMING
5
6#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM)
7# if defined(KEYBOARD_planck_light)
8# define RGB_DI_PIN A0
9# define RGBLED_NUM 13 // Number of LEDs
10# endif
11# define RGBLIGHT_HUE_STEP 12
12# define RGBLIGHT_SAT_STEP 12
13# define RGBLIGHT_VAL_STEP 12
14# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
15# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
16# ifdef RGB_MATRIX_ENABLE
17# define RGBLIGHT_DISABLE_KEYCODES
18# endif
19#endif // RGBLIGHT_ENABLE
20
21#ifdef RGB_MATRIX_ENABLE
22# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot)
23// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
24# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
25// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
26// #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
27# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
28# undef RGB_MATRIX_LED_PROCESS_LIMIT
29# undef RGB_MATRIX_LED_FLUSH_LIMIT
30#endif
31
32#if defined(KEYBOARD_planck_ez)
33# undef PRODUCT
34# define PRODUCT Bocaj Hacked Planck EZ
35#endif
36
37#define EEPROM_I2C_RM24C512C
38
39#define ENCODER_DIRECTION_FLIP
40/*
41 * MIDI options
42 */
43
44/* Prevent use of disabled MIDI features in the keymap */
45//#define MIDI_ENABLE_STRICT 1
46
47/* enable basic MIDI features:
48 - MIDI notes can be sent when in Music mode is on
49*/
50
51// #define MIDI_BASIC
52
53/* enable advanced MIDI features:
54 - MIDI notes can be added to the keymap
55 - Octave shift and transpose
56 - Virtual sustain, portamento, and modulation wheel
57 - etc.
58*/
59//#define MIDI_ADVANCED
60
61/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
62//#define MIDI_TONE_KEYCODE_OCTAVES 2
63
64#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/
65#define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
66#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
67
68/* default 3V ERM vibration motor voltage and library*/
69#if FB_ERM_LRA == 0
70# define RATED_VOLTAGE 3
71# define V_RMS 2.3
72# define V_PEAK 3.30
73/* Library Selection */
74# define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
75
76/* default 2V LRA voltage and library */
77#elif FB_ERM_LRA == 1
78# define RATED_VOLTAGE 2
79# define V_RMS 2.0
80# define V_PEAK 2.85
81# define F_LRA 200
82/* Library Selection */
83# define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
84
85#endif
86
87/* Control 1 register settings */
88#define DRIVE_TIME 25
89#define AC_COUPLE 0
90#define STARTUP_BOOST 1
91
92/* Control 2 Settings */
93#define BIDIR_INPUT 1
94#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */
95#define SAMPLE_TIME 3
96#define BLANKING_TIME 1
97#define IDISS_TIME 1
98
99/* Control 3 settings */
100#define NG_THRESH 2
101#define ERM_OPEN_LOOP 1
102#define SUPPLY_COMP_DIS 0
103#define DATA_FORMAT_RTO 0
104#define LRA_DRIVE_MODE 0
105#define N_PWM_ANALOG 0
106#define LRA_OPEN_LOOP 0
107/* Control 4 settings */
108#define ZC_DET_TIME 0
109#define AUTO_CAL_TIME 3
diff --git a/layouts/community/ortho_4x12/bocaj/keymap.c b/layouts/community/ortho_4x12/bocaj/keymap.c
new file mode 100644
index 000000000..0ac22b4cc
--- /dev/null
+++ b/layouts/community/ortho_4x12/bocaj/keymap.c
@@ -0,0 +1,286 @@
1/*
2Copyright 2020 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "bocaj.h"
19
20#ifdef BACKLIGHT_ENABLE
21enum planck_keycodes {
22 BACKLIT = NEW_SAFE_RANGE,
23 TH_LVL,
24};
25
26#else
27# define BACKLIT OSM(MOD_LSFT)
28enum planck_keycodes {
29 TH_LVL = NEW_SAFE_RANGE,
30};
31#endif
32
33/*
34 * Tap/Hold Wrapper
35 * ,-----------------------------------------------------------------------------------.
36 * | | | | | | | | | | | | |
37 * |------+------+------+------+------+------+------+------+------+------+------+------|
38 * | | |Shift | Cmd | Alt | | | Alt | Cmd |Shift | | |
39 * |------+------+------+------+------+------+------+------+------+------+------+------|
40 * | | Ctrl | | | | | | | | | Ctrl | |
41 * |------+------+------+------+------+------+------+------+------+------+------+------|
42 * | | | | |Lower | |Raise | | | | |
43 * `-----------------------------------------------------------------------------------'
44 */
45#define LAYOUT_ortho_4x12_bocaj(...) WRAPPER_planck_bocaj(__VA_ARGS__)
46
47/*
48 * Base Alphanumeric Wrapper + Tap/Hold Wrapper
49 * ,-----------------------------------------------------------------------------------.
50 * | Esc | | | | | | | | | | | - |
51 * |------+------+------+------+------+------+------+------+------+------+------+------|
52 * | Tab | | | | | HYPR | MEH | | | | | ' |
53 * |------+------+------+------+------+------+------+------+------+------+------+------|
54 * | Shift| | | | | | | | | | | TTMOD|
55 * |------+------+------+------+------+------+------+------+------+------+------+------|
56 * | MOMOD| Lead | Up | Left |BkSpc | Space |Enter |Right | Down | XXX | XXX |
57 * `-----------------------------------------------------------------------------------'
58 */
59#define LAYOUT_ortho_4x12_bocaj_base(...) WRAPPER_planck_bocaj_base(__VA_ARGS__)
60#define LAYOUT_ortho_4x12_bocaj_base_WIN(...) WRAPPER_planck_bocaj_base_WIN(__VA_ARGS__)
61
62const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
63
64 [_WORKMAN] = LAYOUT_ortho_4x12_bocaj_base(
65 _________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
66 _________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
67 _________________WORKMAN_L3________________, _________________WORKMAN_R3________________
68 ),
69 [_WWORKMAN] = LAYOUT_ortho_4x12_bocaj_base_WIN(
70 _________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
71 _________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
72 _________________WORKMAN_L3________________, _________________WORKMAN_R3________________
73 ),
74
75 [_QWERTY] = LAYOUT_ortho_4x12_bocaj_base(
76 _________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
77 _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
78 _________________QWERTY_L3_________________, _________________QWERTY_R3_________________
79 ),
80 [_WQWERTY] = LAYOUT_ortho_4x12_bocaj_base_WIN(
81 _________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
82 _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
83 _________________QWERTY_L3_________________, _________________QWERTY_R3_________________
84 ),
85
86 [_LOWER] = LAYOUT_ortho_4x12_bocaj(
87 ___________________LOWER_L1_EXT____________________, ___________________LOWER_R1_EXT____________________,
88 ___________________LOWER_L2_EXT____________________, ___________________LOWER_R2_EXT____________________,
89 ___________________LOWER_L3_EXT____________________, ___________________LOWER_R3_EXT____________________,
90 _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_COMM, _______, _______
91 ),
92
93 [_RAISE] = LAYOUT_ortho_4x12_bocaj(
94 KC_TILD, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_EQUAL,
95 KC_F11, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_F12,
96 _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
97 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
98 ),
99
100 [_ADJUST] = WRAPPER_ortho_4x12(
101 KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST,
102 VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST,
103 TH_LVL, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL,
104 HPT_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
105 )
106
107};
108// clang-format on
109
110bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
111 switch (keycode) {
112#ifdef BACKLIGHT_ENABLE
113 case BACKLIT:
114 if (record->event.pressed) {
115 register_code(KC_RSFT);
116# ifdef BACKLIGHT_ENABLE
117 backlight_step();
118# endif
119 } else {
120 unregister_code(KC_RSFT);
121 }
122 break;
123#endif
124#ifdef KEYBOARD_planck_ez
125 case TH_LVL:
126 if (record->event.pressed) {
127 keyboard_config.led_level++;
128 if (keyboard_config.led_level > 4) {
129 keyboard_config.led_level = 0;
130 }
131 planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4);
132 planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4);
133 eeconfig_update_kb(keyboard_config.raw);
134 layer_state_set_kb(layer_state);
135 }
136 break;
137#endif
138 }
139 return true;
140}
141
142bool music_mask_user(uint16_t keycode) {
143 switch (keycode) {
144 default:
145 return true;
146 }
147}
148
149#ifdef RGB_MATRIX_ENABLE
150
151// clang-format off
152void suspend_power_down_keymap(void) {
153 rgb_matrix_set_suspend_state(true);
154}
155
156void suspend_wakeup_init_keymap(void) {
157 rgb_matrix_set_suspend_state(false);
158}
159// clang-format on
160
161void rgb_matrix_indicators_user(void) {
162 uint8_t this_mod = get_mods();
163 uint8_t this_led = host_keyboard_leds();
164 uint8_t this_osm = get_oneshot_mods();
165 bool is_ez;
166# ifdef KEYBOARD_planck_ez
167 is_ez = true;
168# endif
169
170 if (g_suspend_state || !rgb_matrix_config.enable) return;
171
172# if defined(RGBLIGHT_ENABLE)
173 if (!userspace_config.rgb_layer_change)
174# else
175 if (userspace_config.rgb_layer_change)
176# endif
177 {
178 switch (get_highest_layer(layer_state)) {
179 case _MOD:
180 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
181 break;
182 case _RAISE:
183 rgb_matrix_layer_helper(HSV_BLUE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
184 break;
185 case _LOWER:
186 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
187 break;
188 case _ADJUST:
189 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
190 break;
191 default: {
192 bool mods_enabled = false;
193 switch (get_highest_layer(default_layer_state)) {
194 case _QWERTY:
195 rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
196 break;
197 case _WQWERTY:
198 rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
199 break;
200 case _WORKMAN:
201 rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
202 break;
203 case _WWORKMAN:
204 rgb_matrix_layer_helper(HSV_GREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
205 break;
206 }
207 break;
208 }
209 }
210 }
211
212 switch (get_highest_layer(default_layer_state)) {
213 case _QWERTY:
214 rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF);
215 break;
216 case _WORKMAN:
217 rgb_matrix_set_color(is_ez ? 41 : 42, 0xD9, 0xA5, 0x21);
218 break;
219 }
220
221 if ((this_mod | this_osm) & MODS_SHIFT_MASK || this_led & (1 << USB_LED_CAPS_LOCK)) {
222 rgb_matrix_set_color_row(0, 0x00, 0xFF, 0x00);
223 }
224 if ((this_mod | this_osm) & MODS_CTRL_MASK && (this_mod | this_osm) & MODS_GUI_MASK) {
225 rgb_matrix_set_color_row(1, 0xFF, 0xD9, 0xFF);
226 } else if ((this_mod | this_osm) & MODS_CTRL_MASK) {
227 rgb_matrix_set_color_row(1, 0xFF, 0x00, 0x00);
228 } else if ((this_mod | this_osm) & MODS_GUI_MASK) {
229 rgb_matrix_set_color_row(1, 0xFF, 0xD9, 0x00);
230 }
231 if ((this_mod | this_osm) & MODS_ALT_MASK) {
232 rgb_matrix_set_color_row(2, 0x00, 0x00, 0xFF);
233 }
234}
235#endif // RGB_MATRIX_INIT
236
237void matrix_init_keymap(void) {}
238
239#ifdef ENCODER_ENABLE
240void encoder_update(bool clockwise) {
241 switch (get_highest_layer(layer_state)) {
242 case _RAISE:
243 clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU);
244 break;
245 case _LOWER:
246# ifdef RGB_MATRIX_ENABLE
247 clockwise ? rgb_matrix_step() : rgb_matrix_step_reverse();
248# else
249 clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP);
250# endif
251 break;
252 case _ADJUST:
253# ifdef AUDIO_CLICKY
254 clockwise ? clicky_freq_up() : clicky_freq_down();
255# endif
256 break;
257 default:
258 clockwise ? tap_code(KC_DOWN) : tap_code(KC_UP);
259 }
260# ifdef AUDIO_CLICKY
261 clicky_play();
262# endif
263}
264#endif // ENCODER_ENABLE
265
266#ifdef KEYBOARD_planck_ez
267layer_state_t layer_state_set_keymap(layer_state_t state) {
268 planck_ez_left_led_off();
269 planck_ez_right_led_off();
270 switch (get_highest_layer(state)) {
271 case _LOWER:
272 planck_ez_left_led_on();
273 break;
274 case _RAISE:
275 planck_ez_right_led_on();
276 break;
277 case _ADJUST:
278 planck_ez_right_led_on();
279 planck_ez_left_led_on();
280 break;
281 default:
282 break;
283 }
284 return state;
285}
286#endif
diff --git a/layouts/community/ortho_4x12/bocaj/readme.md b/layouts/community/ortho_4x12/bocaj/readme.md
new file mode 100644
index 000000000..a3716b8dc
--- /dev/null
+++ b/layouts/community/ortho_4x12/bocaj/readme.md
@@ -0,0 +1,23 @@
1# Overview
2
3This is my Planck EZ layout, heavily based upon [my ergodox layout](../../ergodox/bocaj/).
4
5I got this keyboard for two reasons:
6
71. QMK spoiled me and the Ergodox isn't incredibly portable (ok 3 reasons)
82. This can sit ontop of my janky Macbook Pro keyboard (disabled with Karabiner if the planck is connected) when I want to work from the couch.
9
10## How to Build
11
12Put simply:
13`make planck/ez:bocaj`
14
15On that note, I use a separate workspace when making changes to my layouts or userspace. In that repo, there is a tool that does this for me. See [JacobJerrell/qmk_layouts/tools/](https://github.com/JacobJerrell/qmk_layouts/tree/master/tools) until I get documentation finished (Write code first, define requirements second... right?).
16
17## Layers
18
19* WORKMAN/QWERTY: Default is workman, can be switched via the ADJUST layer. Idk why you would though.
20* LOWER: Nums across the top, switches enter key to tab and tab key to delete. Symbols in the middle, remenascent of the ergodox
21* RAISE: Symbols across the top, F-Keys on the 2nd row. Switches backspace to delete
22* ADJUST: Computer Audio controls, RGB controls, Sound controls, macros, etc.
23* MOD: Mouse controls under the left hand. Numpad under the right hand \ No newline at end of file
diff --git a/layouts/community/ortho_4x12/bocaj/rules.mk b/layouts/community/ortho_4x12/bocaj/rules.mk
new file mode 100644
index 000000000..3383cfd35
--- /dev/null
+++ b/layouts/community/ortho_4x12/bocaj/rules.mk
@@ -0,0 +1,44 @@
1BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = no # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4TAP_DANCE_ENABLE = no
5SPACE_CADET_ENABLE = no
6NKRO_ENABLE = yes
7
8ifneq ($(strip $(KEYBOARD)), planck/rev6)
9 CONSOLE_ENABLE = no
10 COMMAND_ENABLE = no
11 ifeq ($(strip $(LAYOUT_HAS_RGB)), yes)
12 RGBLIGHT_ENABLE = yes
13 INDICATOR_LIGHTS = yes
14 RGBLIGHT_TWINKLE = yes
15 RGBLIGHT_STARTUP_ANIMATION = yes
16 endif
17else
18 CONSOLE_ENABLE = yes
19 COMMAND_ENABLE = yes
20 RGBLIGHT_ENABLE = yes
21 RGBLIGHT_STARTUP_ANIMATION = yes
22 RGB_MATRIX_ENABLE = no
23 AUDIO_ENABLE = yes
24 EEPROM_DRIVER = i2c
25endif
26ifeq ($(strip $(KEYBOARD)), planck/light)
27 RGB_MATRIX_ENABLE = yes
28 RGBLIGHT_ENABLE = yes
29 RGBLIGHT_STARTUP_ANIMATION = yes
30 AUDIO_ENABLE = yes
31 # HAPTIC_ENABLE += SOLENOID
32endif
33ifeq ($(strip $(KEYBOARD)), planck/ez)
34 RGBLIGHT_ENABLE = no
35 # SERIAL_LINK_ENABLE = yes
36 ENCODER_ENABLE = yes
37 RGB_MATRIX_ENABLE = IS31FL3737
38 INDICATOR_LIGHTS = yes
39 RGBLIGHT_TWINKLE = yes
40 RGBLIGHT_STARTUP_ANIMATION = yes
41 CONSOLE_ENABLE = yes
42 COMMAND_ENABLE = yes
43 AUDIO_ENABLE = yes
44endif
diff --git a/users/bocaj/.gitignore b/users/bocaj/.gitignore
new file mode 100644
index 000000000..c6df8c013
--- /dev/null
+++ b/users/bocaj/.gitignore
@@ -0,0 +1 @@
secrets.c
diff --git a/users/bocaj/.gitlab-ci.yml b/users/bocaj/.gitlab-ci.yml
new file mode 100644
index 000000000..71e3d26eb
--- /dev/null
+++ b/users/bocaj/.gitlab-ci.yml
@@ -0,0 +1,24 @@
1stages:
2 - test
3
4QMK Firmware:
5 stage: test
6 variables:
7 GIT_SUBMODULE_STRATEGY: recursive
8 tags:
9 - linux
10 image: qmkfm/base_container
11 before_script:
12 - apt-get update -qy
13 - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr python3 unzip wget zip
14 - avr-gcc --version
15 - uname -a
16 script:
17 - make planck/rev6:default planck/rev5:default
18 - make all:bocaj -j2
19 artifacts:
20 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
21 paths:
22 - ./*.hex
23 - ./*.bin
24 expire_in: 1 month
diff --git a/users/bocaj/bocaj.c b/users/bocaj/bocaj.c
index 689dbe7b4..83fe81231 100644
--- a/users/bocaj/bocaj.c
+++ b/users/bocaj/bocaj.c
@@ -1,5 +1,5 @@
1/* 1/*
2Copyright 2018 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell 2Copyright 2020 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell
3 3
4This program is free software: you can redistribute it and/or modify 4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 5it under the terms of the GNU General Public License as published by
@@ -17,173 +17,194 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18#include "bocaj.h" 18#include "bocaj.h"
19 19
20#ifdef KEYBOARD_planck_ez
20userspace_config_t userspace_config; 21userspace_config_t userspace_config;
21#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) 22#endif
22 #define BOCAJ_UNICODE_MODE UC_OSX 23
24bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) {
25 static uint16_t this_timer;
26 if (pressed) {
27 this_timer = timer_read();
28 } else {
29 if (timer_elapsed(this_timer) < TAPPING_TERM) {
30 tap_code(code);
31 } else {
32 register_code(mod_code);
33 tap_code(code);
34 unregister_code(mod_code);
35 }
36 }
37 return false;
38}
39
40bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) {
41 if (pressed) {
42 this_timer = timer_read();
43 } else {
44 if (timer_elapsed(this_timer) < TAPPING_TERM) {
45 tap_code(code);
46 } else {
47 register_code(mod_code);
48 tap_code(code);
49 unregister_code(mod_code);
50 }
51 }
52 return false;
53}
54
55void bootmagic_lite(void) {
56 matrix_scan();
57#if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0
58 wait_ms(DEBOUNCING_DELAY * 2);
59#elif defined(DEBOUNCE) && DEBOUNCE > 0
60 wait_ms(DEBOUNCE * 2);
23#else 61#else
24 // set to 2 for UC_WIN, set to 4 for UC_WINC 62 wait_ms(30);
25 #define BOCAJ_UNICODE_MODE 2
26#endif 63#endif
64 matrix_scan();
65 if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) {
66 bootloader_jump();
67 }
68}
27 69
28void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; 70__attribute__((weak)) void keyboard_pre_init_keymap(void) {}
29 71
72void keyboard_pre_init_user(void) {
73#ifdef KEYBOARD_planck_ez
74 userspace_config.raw = eeconfig_read_user();
75#endif
76 keyboard_pre_init_keymap();
77}
30// Add reconfigurable functions here, for keymap customization 78// Add reconfigurable functions here, for keymap customization
31// This allows for a global, userspace functions, and continued 79// This allows for a global, userspace functions, and continued
32// customization of the keymap. Use _keymap instead of _user 80// customization of the keymap. Use _keymap instead of _user
33// functions in the keymaps 81// functions in the keymaps
34__attribute__ ((weak)) 82__attribute__((weak)) void matrix_init_keymap(void) {}
35void matrix_init_keymap(void) {}
36
37__attribute__ ((weak))
38void startup_keymap(void) {}
39
40__attribute__ ((weak))
41void suspend_power_down_keymap(void) {}
42 83
43__attribute__ ((weak)) 84// Call user matrix init, set default RGB colors and then
44void suspend_wakeup_init_keymap(void) {} 85// call the keymap's init function
45 86void matrix_init_user(void) {
46__attribute__ ((weak)) 87 matrix_init_keymap();
47void matrix_scan_keymap(void) {}
48
49__attribute__ ((weak))
50bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
51 return true;
52} 88}
53 89
54__attribute__ ((weak)) 90__attribute__((weak)) void keyboard_post_init_keymap(void) {}
55void matrix_scan_secrets(void) {}
56
57__attribute__ ((weak))
58uint32_t layer_state_set_keymap (uint32_t state) {
59 return state;
60}
61 91
62__attribute__ ((weak)) 92void keyboard_post_init_user(void) {
63uint32_t default_layer_state_set_keymap (uint32_t state) { 93#if defined(RGB_MATRIX_ENABLE)
64 return state; 94 keyboard_post_init_rgb_matrix();
95#endif
96 keyboard_post_init_keymap();
65} 97}
66 98
67__attribute__ ((weak)) 99__attribute__((weak)) void shutdown_keymap(void) {}
68void led_set_keymap(uint8_t usb_led) {}
69
70// Call user matrix init, set default RGB colors and then
71// call the keymap's init function
72void matrix_init_user(void) {
73 userspace_config.raw = eeconfig_read_user();
74 100
75 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) 101void rgb_matrix_update_pwm_buffers(void);
76 set_unicode_input_mode(BOCAJ_UNICODE_MODE);
77 get_unicode_input_mode();
78 #endif //UNICODE_ENABLE
79 102
103void shutdown_user(void) {
104#ifdef RGB_MATRIX_ENABLE
105 rgb_matrix_set_color_all(0xFF, 0x00, 0x00);
106 rgb_matrix_update_pwm_buffers();
80 107
81 matrix_init_keymap(); 108#endif // RGB_MATRIX_ENABLE
109 shutdown_keymap();
82} 110}
83 111
84void startup_user (void) { 112__attribute__((weak)) void suspend_power_down_keymap(void) {}
85 startup_keymap();
86}
87 113
88void suspend_power_down_user(void) 114void suspend_power_down_user(void) { suspend_power_down_keymap(); }
89{
90 suspend_power_down_keymap();
91}
92 115
93void suspend_wakeup_init_user(void) 116__attribute__((weak)) void suspend_wakeup_init_keymap(void) {}
94{
95 suspend_wakeup_init_keymap();
96 #ifdef KEYBOARD_ergodox_ez
97 wait_ms(10);
98 #endif
99}
100 117
101void eeconfig_init_user(void) { 118void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); }
102 userspace_config.raw = 0; 119
103 eeconfig_update_user(userspace_config.raw); 120__attribute__((weak)) void matrix_scan_secrets(void) {}
104 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) 121__attribute__((weak)) void matrix_scan_keymap(void) {}
105 set_unicode_input_mode(BOCAJ_UNICODE_MODE);
106 get_unicode_input_mode();
107 #else
108 eeprom_update_byte(EECONFIG_UNICODEMODE, BOCAJ_UNICODE_MODE);
109 #endif
110}
111 122
112LEADER_EXTERNS(); 123LEADER_EXTERNS();
124
113// No global matrix scan code, so just run keymap's matrix 125// No global matrix scan code, so just run keymap's matrix
114// scan function 126// scan function
115void matrix_scan_user(void) { 127void matrix_scan_user(void) {
116 static bool has_ran_yet; 128 static bool has_ran_yet;
117 if (!has_ran_yet) { 129 if (!has_ran_yet) {
118 has_ran_yet = true; 130 has_ran_yet = true;
119 startup_user(); 131 startup_user();
120 }
121 LEADER_DICTIONARY() {
122 leading = false;
123 leader_end();
124
125 // Mac Save (Leader -> s)
126 SEQ_ONE_KEY(KC_S) {
127 SEND_STRING(SS_LGUI("s"));
128 } 132 }
129 133
130 // Mac copy line down (Leader -> d, d) 134 LEADER_DICTIONARY() {
131 SEQ_TWO_KEYS(KC_D, KC_D) { 135 leading = false;
132 register_code(KC_LSHIFT); 136 leader_end();
133 register_code(KC_HOME);
134 unregister_code(KC_HOME);
135 unregister_code(KC_LSHIFT);
136 SEND_STRING(SS_LGUI("c"));
137 tap(KC_END);
138 tap(KC_ENTER);
139 SEND_STRING(SS_LGUI("v"));
140 }
141 137
142 // Mac copy line up (Leader -> u, u) 138 // Website Refresh / XCode "Run"
143 SEQ_TWO_KEYS(KC_U, KC_U) { 139 SEQ_ONE_KEY(KC_R) {
144 register_code(KC_LSHIFT); 140 SEND_STRING(SS_LGUI("r"));
145 register_code(KC_HOME); 141 }
146 unregister_code(KC_HOME);
147 unregister_code(KC_LSHIFT);
148 SEND_STRING(SS_LGUI("c"));
149 tap(KC_UP);
150 tap(KC_END);
151 tap(KC_ENTER);
152 SEND_STRING(SS_LGUI("v"));
153 }
154 142
155 // Mac VS Debug 143 SEQ_TWO_KEYS(KC_B, KC_D) {
156 SEQ_ONE_KEY(KC_D) { 144 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " Built at: " QMK_BUILDDATE);
157 tap(KC_F5); 145 }
158 }
159 146
160 // Mac VS Stop Debug 147 #ifndef NO_SECRETS
161 SEQ_TWO_KEYS(KC_S, KC_D) { 148 matrix_scan_secrets();
162 register_code(KC_LSHIFT); 149 #endif // !NO_SECRETS
163 tap(KC_F5);
164 unregister_code(KC_LSHIFT);
165 } 150 }
151
152#if defined(RGB_MATRIX_ENABLE)
153 matrix_scan_rgb_matrix();
154#endif
166 155
167 // Start Diablo 3 156 matrix_scan_keymap();
168 SEQ_ONE_KEY(KC_3) { 157}
169 SEND_STRING(SS_LCTRL(" "));
170 SEND_STRING("Diablo");
171 tap(KC_ENTER);
172 }
173 158
174 SEQ_ONE_KEY(KC_B) { 159__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; }
175 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " "); 160
176 tap(KC_ENTER); 161// on layer change, no matter where the change was initiated
177 SEND_STRING ("Built at: " QMK_BUILDDATE); 162// Then runs keymap's layer change check
178 } 163layer_state_t layer_state_set_user(layer_state_t state) {
179#ifndef NO_SECRETS 164 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
180 matrix_scan_secrets(); 165#if defined(RGBLIGHT_ENABLE)
181#endif // !NO_SECRETS 166 state = layer_state_set_rgb_light(state);
182 } 167#endif // RGBLIGHT_ENABLE
168 return layer_state_set_keymap(state);
169}
170
171__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; }
172
173// Runs state check and changes underglow color and animation
174layer_state_t default_layer_state_set_user(layer_state_t state) {
175 state = default_layer_state_set_keymap(state);
176#if 0
177# if defined(RGB_MATRIX_ENABLE)
178 state = default_layer_state_set_rgb(state);
179# endif // RGB_MATRIX_ENABLE
180#endif
181 return state;
182}
183
184__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {}
185
186// Any custom LED code goes here.
187// So far, I only have keyboard specific code,
188// So nothing goes here.
189void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); }
190
191__attribute__((weak)) void eeconfig_init_keymap(void) {}
192
193void eeconfig_init_user(void) {
194#ifdef KEYBOARD_planck_ez
195 userspace_config.raw = 0;
196# if defined(RGB_MATRIX_ENABLE)
197 userspace_config.rgb_layer_change = true;
198# endif
199 eeconfig_update_user(userspace_config.raw);
200#endif
201 eeconfig_init_keymap();
202 keyboard_init();
203}
183 204
184#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. 205bool hasAllBitsInMask(uint8_t value, uint8_t mask) {
185 run_diablo_macro_check(); 206 value &= 0xF;
186#endif // TAP_DANCE_ENABLE 207 mask &= 0xF;
187 208
188 matrix_scan_keymap(); 209 return (value & mask) == mask;
189} 210}
diff --git a/users/bocaj/bocaj.h b/users/bocaj/bocaj.h
index 04991a015..e69be74da 100644
--- a/users/bocaj/bocaj.h
+++ b/users/bocaj/bocaj.h
@@ -1,5 +1,6 @@
1/* 1/*
2Copyright 2018 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell 2Copyright 2017 Christopher Courtney <drashna@live.com> @drashna
3Copyright 2020 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell
3 4
4This program is free software: you can redistribute it and/or modify 5This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 6it under the terms of the GNU General Public License as published by
@@ -16,70 +17,57 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 17*/
17 18
18#pragma once 19#pragma once
19#include "quantum.h" 20#include QMK_KEYBOARD_H
21
20#include "version.h" 22#include "version.h"
21#include "eeprom.h" 23#include "eeprom.h"
22#include "wrappers.h"
23#include "process_records.h" 24#include "process_records.h"
24#ifdef TAP_DANCE_ENABLE 25#include "wrappers.h"
25 #include "tap_dances.h" 26#if defined(RGB_MATRIX_ENABLE)
26#endif // TAP_DANCE_ENABLE 27# include "rgb_matrix_stuff.h"
28#endif
27 29
28/* Layer Names */ 30/* Define layer names */
29enum userspace_layers { 31enum userspace_layers {
30 _WORKMAN = 0, 32 _WORKMAN = 0,
31 _WINWORKMAN, 33 _QWERTY,
32 _QWERTY, 34 _WWORKMAN,
33 _LOWER, 35 _WQWERTY,
34 _ADJUST, 36 _LOWER,
35 _DIABLO, 37 _RAISE,
38 _ADJUST,
39 _MOD,
40 LAYER_SAFE_RANGE,
36}; 41};
37 42
38#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
39 #define BOCAJ_UNICODE_MODE UC_OSX
40#else
41 // set to 2 for UC_WIN, set to 4 for UC_WINC
42 #define BOCAJ_UNICODE_MODE 2
43#endif
44
45/*
46define modifiers here, since MOD_* doesn't seem to work for these
47 */
48#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) 43#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
49#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) 44#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
50#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) 45#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
51#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) 46#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
52 47
53bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); 48bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed);
54bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); 49bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
55bool send_game_macro(const char *str, keyrecord_t *record, bool override); 50void matrix_init_keymap(void);
56void matrix_init_keymap(void); 51void shutdown_keymap(void);
57void shutdown_keymap(void); 52void suspend_power_down_keymap(void);
58void suspend_power_down_keymap(void); 53void suspend_wakeup_init_keymap(void);
59void suspend_wakeup_init_keymap(void); 54void matrix_scan_keymap(void);
60void matrix_scan_keymap(void); 55layer_state_t layer_state_set_keymap(layer_state_t state);
61uint32_t layer_state_set_keymap (uint32_t state); 56layer_state_t default_layer_state_set_keymap(layer_state_t state);
62uint32_t default_layer_state_set_keymap (uint32_t state); 57void led_set_keymap(uint8_t usb_led);
63void led_set_keymap(uint8_t usb_led); 58void eeconfig_init_keymap(void);
64void eeconfig_init_keymap(void); 59bool hasAllBitsInMask(uint8_t value, uint8_t mask);
65void tap(uint16_t keycode);
66 60
61// clang-format off
62#ifdef KEYBOARD_planck_ez
67typedef union { 63typedef union {
68 uint8_t raw; 64 uint32_t raw;
65 struct {
66 bool rgb_layer_change :1;
67 bool rgb_matrix_idle_anim :1;
68 };
69} userspace_config_t; 69} userspace_config_t;
70// clang-format on
70 71
71extern userspace_config_t userspace_config; 72extern userspace_config_t userspace_config;
72 73#endif
73// If Tap Dancing is enabled, we manage that here.
74// If it is not, then we define the KC_D3_# codes gracefully
75#ifdef TAP_DANCE_ENABLE
76 #define KC_D3_1 TD(TD_D3_1)
77 #define KC_D3_2 TD(TD_D3_2)
78 #define KC_D3_3 TD(TD_D3_3)
79 #define KC_D3_4 TD(TD_D3_4)
80#else // !TAP_DANCE_ENABLE
81 #define KC_D3_1 KC_1
82 #define KC_D3_2 KC_2
83 #define KC_D3_3 KC_3
84 #define KC_D3_4 KC_4
85#endif // TAP_DANCE_ENABLE
diff --git a/users/bocaj/config.h b/users/bocaj/config.h
index 1956ea6d9..2a44aabfc 100644
--- a/users/bocaj/config.h
+++ b/users/bocaj/config.h
@@ -1,8 +1,82 @@
1#pragma once 1#pragma once
2 2
3#ifndef QMK_KEYS_PER_SCAN 3// Use custom magic number so that when switching branches, EEPROM always gets reset
4 #define QMK_KEYS_PER_SCAN 4 4#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1339
5#endif // QMK KEYS PER SCAN 5
6/* Set Polling rate to 1000Hz */
7#define USB_POLLING_INTERVAL_MS 1
8
9#ifdef AUDIO_ENABLE
10
11# define AUDIO_CLICKY
12# define STARTUP_SONG SONG(RICK_ROLL)
13# define GOODBYE_SONG SONG(SONIC_RING)
14# define DEFAULT_LAYER_SONGS \
15 { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(OVERWATCH_THEME) }
16
17# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f
18
19# define UNICODE_SONG_MAC SONG(RICK_ROLL)
20# define UNICODE_SONG_LNX SONG(RICK_ROLL)
21# define UNICODE_SONG_WIN SONG(RICK_ROLL)
22# define UNICODE_SONG_BSD SONG(RICK_ROLL)
23# define UNICODE_SONG_WINC SONG(RICK_ROLL)
24#endif // !AUDIO_ENABLE
25
26#ifdef RGB_MATRIX_ENABLE
27# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot)
28// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
29# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
30// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
31# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
32// # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
33// # define EECONFIG_RGB_MATRIX (uint32_t *)16
34
35# if defined(__AVR__) && !defined(__AVR_AT90USB1286__)
36# define DISABLE_RGB_MATRIX_ALPHAS_MODS
37# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
38# define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
39# define DISABLE_RGB_MATRIX_BREATHING
40# define DISABLE_RGB_MATRIX_BAND_SAT
41# define DISABLE_RGB_MATRIX_BAND_VAL
42# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
43# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
44# define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT
45# define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL
46# define DISABLE_RGB_MATRIX_CYCLE_ALL
47# define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
48# define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN
49# define DISABLE_RGB_MATRIX_CYCLE_OUT_IN
50// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
51# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
52# define DISABLE_RGB_MATRIX_DUAL_BEACON
53# define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL
54# define DISABLE_RGB_MATRIX_CYCLE_SPIRAL
55# define DISABLE_RGB_MATRIX_RAINBOW_BEACON
56# define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS
57# define DISABLE_RGB_MATRIX_RAINDROPS
58# define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
59// # define DISABLE_RGB_MATRIX_TYPING_HEATMAP
60# define DISABLE_RGB_MATRIX_DIGITAL_RAIN
61# define DISABLE_RGB_MATRIX_SOLID_REACTIVE
62# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
63# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
64# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
65# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
66# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
67# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
68# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
69# define DISABLE_RGB_MATRIX_SPLASH
70# define DISABLE_RGB_MATRIX_MULTISPLASH
71# define DISABLE_RGB_MATRIX_SOLID_SPLASH
72# define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH
73# endif // AVR
74#endif // RGB_MATRIX_ENABLE
75
76#ifdef QMK_KEYS_PER_SCAN
77# undef QMK_KEYS_PER_SCAN
78# define QMK_KEYS_PER_SCAN 1
79#endif // !QMK_KEYS_PER_SCAN
6 80
7// this makes it possible to do rolling combos (zx) with keys that 81// this makes it possible to do rolling combos (zx) with keys that
8// convert to other keys on hold (z becomes ctrl when you hold it, 82// convert to other keys on hold (z becomes ctrl when you hold it,
@@ -10,24 +84,30 @@
10// actually sends Ctrl-x. That's bad.) 84// actually sends Ctrl-x. That's bad.)
11#define IGNORE_MOD_TAP_INTERRUPT 85#define IGNORE_MOD_TAP_INTERRUPT
12#undef PERMISSIVE_HOLD 86#undef PERMISSIVE_HOLD
13#define PREVENT_STUCK_MODIFIERS 87//#define TAPPING_FORCE_HOLD
88//#define RETRO_TAPPING
89
90#define FORCE_NKRO
91
92#ifndef TAPPING_TOGGLE
93# define TAPPING_TOGGLE 1
94#endif
14 95
15#ifdef TAPPING_TERM 96#ifdef TAPPING_TERM
16#undef TAPPING_TERM 97# undef TAPPING_TERM
17#endif // TAPPING_TERM 98#endif // TAPPING_TERM
18#define TAPPING_TERM 175 99#if defined(KEYBOARD_ergodox_ez)
19 100# define TAPPING_TERM 185
20#define RETRO_TAPPING 101#else
21 102# define TAPPING_TERM 175
22// Disable action_get_macro and fn_actions, since we don't use these 103#endif
23// and it saves on space in the firmware. 104
24#ifndef NO_DEBUG 105#define TAP_CODE_DELAY 5
25#define NO_DEBUG 106
26#endif // !NO_DEBUG 107/* Disable unused and unneeded features to reduce on firmware size */
27#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) 108#ifdef LOCKING_SUPPORT_ENABLE
28#define NO_PRINT 109# undef LOCKING_SUPPORT_ENABLE
29#endif // !NO_PRINT 110#endif
30#define NO_ACTION_MACRO 111#ifdef LOCKING_RESYNC_ENABLE
31#define NO_ACTION_FUNCTION 112# undef LOCKING_RESYNC_ENABLE
32 113#endif
33#define MACRO_TIMER 5
diff --git a/users/bocaj/process_records.c b/users/bocaj/process_records.c
index c36683f8b..9eb181ad4 100644
--- a/users/bocaj/process_records.c
+++ b/users/bocaj/process_records.c
@@ -1,149 +1,111 @@
1#include "bocaj.h" 1#include "bocaj.h"
2#include QMK_KEYBOARD_H 2#include <print.h>
3 3
4uint16_t copy_paste_timer; 4__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
5uint16_t grave_layer_timer;
6uint16_t heal_layer_timer;
7 5
8__attribute__ ((weak)) 6__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; }
9bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
10 return true;
11}
12 7
13// Defines actions tor my global custom keycodes. Defined in bocaj.h file 8// Defines actions tor my global custom keycodes. Defined in bocaj.h file
14// Then runs the _keymap's record handler if not processed here 9// Then runs the _keymap's record handler if not processed here
15bool process_record_user(uint16_t keycode, keyrecord_t *record) { 10bool process_record_user(uint16_t keycode, keyrecord_t *record) {
16 switch (keycode) { 11
17 case KC_MWRK: 12 if (process_record_keymap(keycode, record) && process_record_secrets(keycode, record)
18 if (!record->event.pressed) { 13#ifdef RGB_MATRIX_ENABLE
19 set_single_persistent_default_layer(_WORKMAN); 14 && process_record_user_rgb_matrix(keycode, record)
20 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) 15#endif
21 set_unicode_input_mode(0); 16 ) {
22 #endif 17 switch (keycode) {
23 layer_move(0); 18 case KC_WORKMAN:
24 ergodox_blink_all_leds(); 19 if (!record->event.pressed) {
25 } 20 uint8_t mods = mod_config(get_mods());
26 break; 21 if (!mods) {
27 case KC_WWRK: 22 set_single_persistent_default_layer(_WORKMAN);
28 if (!record->event.pressed) { 23
29 set_single_persistent_default_layer(_WINWORKMAN); 24 } else if (mods & (MODS_GUI_MASK | MODS_CTRL_MASK)) {
30 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) 25 set_single_persistent_default_layer(_WWORKMAN);
31 set_unicode_input_mode(4); 26 }
32 #endif 27 }
33 layer_move(0); 28 return false;
34 ergodox_blink_all_leds(); 29 break;
35 } 30 case KC_QWERTY:
36 break; 31 if (!record->event.pressed) {
37 case KC_MQWR: 32 uint8_t mods = mod_config(get_mods());
38 if (!record->event.pressed) { 33 if (!mods) {
39 set_single_persistent_default_layer(_QWERTY); 34 set_single_persistent_default_layer(_QWERTY);
40 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) 35 } else if (mods & (MODS_GUI_MASK | MODS_CTRL_MASK)) {
41 set_unicode_input_mode(0); 36 set_single_persistent_default_layer(_WQWERTY);
42 #endif 37 }
43 layer_move(0); 38 }
44 ergodox_blink_all_leds(); 39 return false;
45 } 40 break;
46 break; 41
47 case MC_LOCK: 42 case MC_ARRW:
48 if (!record->event.pressed) { 43 if (!record->event.pressed) {
49 layer_move(0); 44 clear_mods();
50 SEND_STRING(SS_LCTRL(SS_LGUI("q"))); 45 send_string_with_delay_P(PSTR("->"), TAP_CODE_DELAY);
51 } 46 }
52 break; 47 return false;
53 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader 48 break;
54 if (!record->event.pressed) { 49
55 uint8_t temp_mod = get_mods(); 50 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
56 uint8_t temp_osm = get_oneshot_mods(); 51 if (!record->event.pressed) {
57 clear_mods(); 52 clear_mods();
58 clear_oneshot_mods(); 53 send_string_with_delay_P(PSTR("qmk compile "), TAP_CODE_DELAY);
59 if (biton32(default_layer_state) == _WINWORKMAN) { 54 send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD), TAP_CODE_DELAY);
60 send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); 55 send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY);
61 } else { 56 }
62 send_string_with_delay_P(PSTR("util/docker_build.sh " QMK_KEYBOARD ":" QMK_KEYMAP), 10); 57 return false;
63 } 58 break;
64 if (temp_mod & MODS_SHIFT_MASK) { 59
65 send_string_with_delay_P(PSTR(":teensy"), 10); 60 case VRSN: // Prints firmware version
66 } 61 if (!record->event.pressed) {
67 if (temp_mod & MODS_CTRL_MASK) { 62 send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY);
68 send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); 63 }
69 } 64 break;
70 send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); 65#if defined(RGB_MATRIX_ENABLE)
71 set_mods(temp_mod); 66 case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
72 layer_move(0); 67 if (!record->event.pressed) {
73 } 68 userspace_config.rgb_layer_change ^= 1;
74 break; 69 dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
75 case KC_DCLR: // reset all Diablo timers, disabling them 70 eeconfig_update_user(userspace_config.raw);
76#ifdef TAP_DANCE_ENABLE 71 if (userspace_config.rgb_layer_change) {
77 if (record->event.pressed) { 72 rgblight_enable_noeeprom();
78 uint8_t dtime; 73 layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
79 for (dtime = 0; dtime < 4; dtime++) { 74 } else {
80 diablo_key_time[dtime] = diablo_times[0]; 75 rgblight_disable_noeeprom();
81 } 76 }
82 } 77 }
83#endif // TAP_DANCE_ENABLE 78 return false;
84 break; 79 break;
85 case JJ_ARRW: 80 case RGB_TOG:
86 if (!record->event.pressed) { 81 if (!record->event.pressed) {
87 SEND_STRING("->"); 82# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)
88 } 83 rgb_matrix_toggle();
89 return false; 84# endif
90 break; 85 }
91 case LM_GRAVE: 86 return false;
92 if (record->event.pressed) { 87 break;
93 grave_layer_timer = timer_read(); 88 case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
94 } else { 89 if (!record->event.pressed) {
95 if (timer_elapsed(grave_layer_timer) < TAPPING_TERM) { 90 bool is_eeprom_updated;
96 uint8_t temp_mod = get_mods(); 91# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
97 uint8_t one_shot = get_oneshot_mods(); 92 if (userspace_config.rgb_matrix_idle_anim) {
98 clear_mods(); 93 userspace_config.rgb_matrix_idle_anim = false;
99 if (temp_mod & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) { 94 dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
100 register_code(KC_LSFT); 95 is_eeprom_updated = true;
101 tap(KC_GRAVE); 96 }
102 unregister_code(KC_LSFT); 97# endif
103 } else { 98 if (is_eeprom_updated) {
104 tap(KC_GRAVE); 99 eeconfig_update_user(userspace_config.raw);
105 } 100 }
106 set_mods(temp_mod); 101 }
107 } else { 102 return false;
108 layer_move(0); 103 break;
109 } 104#endif
110 }
111 return false;
112 break;
113 case KC_CCCV:
114 if (record->event.pressed) {
115 copy_paste_timer = timer_read();
116 } else {
117 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
118 SEND_STRING(SS_LGUI("c"));
119 } else {
120 SEND_STRING(SS_LGUI("v"));
121 } 105 }
122 } 106 }
123 return false; 107#ifdef CONSOLE_ENABLE
124 break; 108 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
125#ifdef UNICODE_ENABLE
126 case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
127 if (record->event.pressed) {
128 send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B");
129 }
130 break;
131 case UC_TABL: // ┬─┬ノ( º _ ºノ)
132 if (record->event.pressed) {
133 send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029");
134 }
135 break;
136 case UC_SHRG: // ¯\_(ツ)_/¯
137 if (record->event.pressed) {
138 send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
139 }
140 break;
141 case UC_DISA: // ಠ_ಠ
142 if (record->event.pressed) {
143 send_unicode_hex_string("0CA0 005F 0CA0");
144 }
145 break;
146#endif 109#endif
147 } 110 return true;
148 return process_record_keymap(keycode, record);
149} 111}
diff --git a/users/bocaj/process_records.h b/users/bocaj/process_records.h
index 5c55df35e..c17e2ffdc 100644
--- a/users/bocaj/process_records.h
+++ b/users/bocaj/process_records.h
@@ -2,49 +2,43 @@
2#include "bocaj.h" 2#include "bocaj.h"
3 3
4#if defined(KEYMAP_SAFE_RANGE) 4#if defined(KEYMAP_SAFE_RANGE)
5 #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE 5# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE
6#else 6#else
7 #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE 7# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE
8#endif 8#endif
9 9
10enum userspace_custom_keycodes { 10enum userspace_custom_keycodes {
11 KC_EPRM = PLACEHOLDER_SAFE_RANGE, // can always be here 11 VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info
12 KC_MWRK, 12 KC_WORKMAN, // Sets default layer to WORKMAN
13 KC_WWRK, 13 KC_QWERTY, // Sets default layer to QWERTY
14 KC_MQWR, 14 // KC_COLEMAK, // Sets default layer to COLEMAK
15 KC_VRSN, 15 // KC_DVORAK, // Sets default layer to DVORAK
16 LM_GRAVE, // Shift if held, layer change if tapped 16 KC_MAKE, // Run keyboard's customized make command
17 JJ_COPY, 17 KC_RGB_T, // Toggles RGB Layer Indication mode
18 JJ_PSTE, 18 RGB_IDL, // RGB Idling animations
19 JJ_ARRW, 19 MC_ARRW, // ->
20 KC_CCCV, 20 UC_FLIP, // (ಠ痊ಠ)┻━┻
21 MC_LOCK, 21 UC_TABL, // ┬─┬ノ( º _ ºノ)
22 KC_DCLR, 22 UC_SHRG, // ¯\_(ツ)_/¯
23 KC_MAKE, 23 UC_DISA, // ಠ_ಠ
24 UC_FLIP, // (ಠ痊ಠ)┻━┻ 24 NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes
25 UC_TABL, // ┬─┬ノ( º _ ºノ)
26 UC_SHRG, // ¯\_(ツ)_/¯
27 UC_DISA, // ಠ_ಠ
28 NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
29}; 25};
30 26
27bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
31bool process_record_keymap(uint16_t keycode, keyrecord_t *record); 28bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
32 29
33// One Shot 30#define QWERTY KC_QWERTY
34#define OS_LSFT OSM(MOD_LSFT) 31#define WORKMAN KC_WORKMAN
35 32
36// Space Cadet Hyper/Meh and [/] 33#define KC_ARRW MC_ARRW
37#define HYP_LBK ALL_T(KC_LBRACKET)
38#define MEH_RBK MEH_T(KC_RBRACKET)
39 34
40#define GUI_CTR(os, kc) MT( (os == 0) ? (MOD_LGUI) : (MOD_LCTL), kc ) 35#define KC_RST RESET
41 36
42// Layout beauti-/simpli-fication 37#define MO_MOD MO(_MOD)
43#define KC_LWEN LT(_LOWER, KC_ENTER) 38#define ALT_APP ALT_T(KC_APP)
44#define KC_ADJS TT(_ADJUST) 39#define HYP_LBK ALL_T(KC_LBRACKET)
45#define KC_NUMS TT(_LOWER) 40#define MEH_RBK MEH_T(KC_RBRACKET)
46#define KC_GAME TT(_DIABLO) 41#define HYP_LPR ALL_T(KC_LPRN)
42#define MEH_RPR MEH_T(KC_RPRN)
47 43
48// Other Keycodes 44#define MG_NKRO MAGIC_TOGGLE_NKRO
49#define KC_RST RESET
50#define KC_BS KC_BSLASH
diff --git a/users/bocaj/readme.md b/users/bocaj/readme.md
index 669299cb0..120635967 100644
--- a/users/bocaj/readme.md
+++ b/users/bocaj/readme.md
@@ -1,102 +1,5 @@
1# Overview 1# Overview
2 2
3My personal QMK userspace. First, I must say that the credit for a majority of the code found here belongs to Drashna and/or the people he derived his code from. My Ergodox layout is briefly described in its respective folder. As for explaining this userspace, you could honestly go to Drashna's userspace and read his well put together readme. Regardless, I am mostly writing this as an excercise for myself to better understand what is going on, and where applicable, describe things that I innovated on my own. 3This is my personal userspace file. Most of my code exists here, as it's heavily shared.
4 4
5## Bocaj.c 5The template was taken from [Drashna's userspace](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). There isn't much if anything in this userspace that warrants documentation he hasn't already covered.
6
7### Unicode
8
9I've always had difficulty implementing unicode in QMK, all of this code is literally copy/pasted from Drashna's userspace and lies dormant here until I can take the time to figure it out.
10
11Update: Got it to work in Mac OS which is more important to me than Windows (probably pretty easy to figure out at this point). So I'm a happy table flipping person now!
12
13(ノಠ痊ಠ)ノ彡┻━┻
14
15┬─┬ノ( º _ ºノ)
16
17### Tap Macro
18
19Not sure why this doesn't exist in QMK already (maybe it does?)
20
21```c
22void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
23```
24
25### *_keymap functions
26
27We're running *_user functions in the userspace, that way we can add to or reconfigure at the keyboard level. Any *_user functions should call the equivalent *_keymap function at the end. If the *_keymap function isn't defined in the keymap, the `__attribute__ ((weak))` will prevent build problems.
28
29### Startup/Suspend/Shutdown Functions
30
31I have no idea what these do. Non-Ergodox keyboard functions?
32
33### Matrix Scan User
34
35Leader key defines, Diablo macro ancillary function, run matrix_scan_keymap.
36
37#### Leader Key
38
39I've always been interested in this feature, but I've had 0 experience with applications that have similar behavior. My implementation seeks to implement features that I feel VS2017 lacks
40
41## Secrets
42
43Hacked Drashna's secret macro implementation to work with the leader key instead.
44TODO: Finish documentation
45
46## Bocaj.h
47
48Layer defines, some macro ancillary defines, setup Diablo macros and failsafe
49
50## Process_Records.c/.h
51
52Again, taking ideas from Drashna to make maintenance simpler. A couple of things that I'm proud of here, but nothing really ground breaking.
53
54* Features
55 * Change default layer
56 * KC_MWRK, KC_WWRK, KC_MQWR
57 * MacOS Lock Screen Macro
58 * Make macro (Credit: Drashna)
59 * Need to reconfigure so it runs the docker command if one of the Mac OS layers are default because the AVR install fails on the corporate laptop
60 * Arrow macro (->) because I find myself telling people how to get to something quite frequently and typing this manually requires moving the right hand to the top-left of the ergodox and then to the bottom right, which feels unnatural.
61 * LM_GRAVE
62 * While combining _NUMS and _LOWER, I also needed a place to put F1-12 keys. This required me to relocate the grave key. The most comfortable place to put it was over a key that I frequently use to toggle the numpad. I do have other ways to get to/from this layer but my mind has been wired to use them for different workflows, so I would sit here frozen for a moment trying to tell my fingers where to go
63 * How it works
64 * A timer starts when pressed down
65 * If the timer at release was less than the TAPPING_TERM define
66 * Get mods
67 * If Shift was held or one-shot shift was active
68 * Send `~`
69 * Else
70 * Send `
71 * Else (timer at released was greater than the TAPPING_TERM define)
72 * Move to the default layer
73 * KC_CCCV
74 * Another neat idea I found in Drashna's userspace... highly underutilized in my layout but the inspiration for LM_GRAVE was obviously derived from this code
75 * Unicode stuff
76 * All I've ever wanted was a table-flip macro... I managed to get about half of it to work before I gave up and disabled it
77
78## Send_Unicode.c/.h
79
80I have some basic understanding of this, Drashna may already have it documented in his userspace. I'll put it in my own words when I get around to making it work and understanding it better.
81
82## Tap_Dances.c/h
83
84Again, building on Drashna's userspace organization to simplify maintenance of a heavily configured layout. This is all the stuff for the Diablo 3 macros that spam a given skill (1-4) every ~1 second
85
86## Wrappers.h
87
88Traditionally, you would put all of this into the \<username>.h file. But I liked the idea of separating it to simplify modification in the future.
89
90### GUI_CTR(os, kc)
91
92A notable mention in this file is the GUI_CTR(os, kc) custom keycode defined in process_records.h as:
93
94```c
95#define GUI_CTR(os, kc) MT( (os == 0) ? (MOD_LGUI) : (MOD_LCTL), kc )
96```
97
98I tried several things before coming to this one-liner conclusion. I believe it is quite elegant and it definitely solves the problem I had (separate wrappers for Windows/MacOS layers). But I would love to make this into something more intuitive, like a macro that detects which layer you're on and sends the applicable hotkey when held, or keycode when tapped. Ultimately, I was too tired of thinking about it to come up with a solution like that at this time.
99
100Anyhow, if you set `os == 1`, it sends the Windows CTRL hotkey when held. If you set `os == 0`, it sends the Mac OS GUI hotkey when held. If tapped, it sends the keycode.
101
102This is effectively a slightly more advanced `MOD_T(kc)` keycode.
diff --git a/users/bocaj/rgb_matrix_stuff.c b/users/bocaj/rgb_matrix_stuff.c
new file mode 100644
index 000000000..bc50349d2
--- /dev/null
+++ b/users/bocaj/rgb_matrix_stuff.c
@@ -0,0 +1,106 @@
1#include "bocaj.h"
2
3#include "lib/lib8tion/lib8tion.h"
4extern led_config_t g_led_config;
5
6static uint32_t hypno_timer;
7#if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_crkbd)
8# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL
9#else
10# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN
11#endif
12
13void rgb_matrix_set_color_row(uint8_t row, uint8_t red, uint8_t green, uint8_t blue) {
14#ifdef KEYBOARD_planck_ez
15 if (row > 2) {
16 row = 0;
17 }
18 uint8_t row_multiplier = row * 12;
19
20 rgb_matrix_set_color(1 + row_multiplier, red, green, blue);
21 rgb_matrix_set_color(2 + row_multiplier, red, green, blue);
22 rgb_matrix_set_color(3 + row_multiplier, red, green, blue);
23 rgb_matrix_set_color(4 + row_multiplier, red, green, blue);
24 rgb_matrix_set_color(5 + row_multiplier, red, green, blue);
25 rgb_matrix_set_color(6 + row_multiplier, red, green, blue);
26 rgb_matrix_set_color(7 + row_multiplier, red, green, blue);
27 rgb_matrix_set_color(8 + row_multiplier, red, green, blue);
28 rgb_matrix_set_color(9 + row_multiplier, red, green, blue);
29 rgb_matrix_set_color(10 + row_multiplier, red, green, blue);
30#endif
31}
32
33void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type) {
34 HSV hsv = {hue, sat, val};
35 if (hsv.v > rgb_matrix_get_val()) {
36 hsv.v = rgb_matrix_get_val();
37 }
38
39 switch (mode) {
40 case 1: // breathing
41 {
42 uint16_t time = scale16by8(g_rgb_timer, speed / 8);
43 hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v);
44 RGB rgb = hsv_to_rgb(hsv);
45 for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
46 if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
47 rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
48 }
49 }
50 break;
51 }
52 default: // Solid Color
53 {
54 RGB rgb = hsv_to_rgb(hsv);
55 for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
56 if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
57 rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
58 }
59 }
60 break;
61 }
62 }
63}
64
65__attribute__((weak)) void rgb_matrix_indicator_keymap(void) {}
66
67void matrix_scan_rgb_matrix(void) {
68#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
69 if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && timer_elapsed32(hypno_timer) > 15000) {
70 rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE);
71 }
72#endif
73 rgb_matrix_indicator_keymap();
74}
75
76void keyboard_post_init_rgb_matrix(void) {
77#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
78 if (userspace_config.rgb_matrix_idle_anim) {
79 rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE);
80 }
81#endif
82}
83
84bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) {
85#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
86 hypno_timer = timer_read32();
87 if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) {
88 rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP);
89 }
90#endif
91 switch (keycode) {
92 case RGB_IDL:
93#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
94 if (record->event.pressed) {
95 userspace_config.rgb_matrix_idle_anim ^= 1;
96 dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
97 eeconfig_update_user(userspace_config.raw);
98 if (userspace_config.rgb_matrix_idle_anim) {
99 rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP);
100 }
101 }
102#endif
103 break;
104 }
105 return true;
106}
diff --git a/users/bocaj/rgb_matrix_stuff.h b/users/bocaj/rgb_matrix_stuff.h
new file mode 100644
index 000000000..e48add218
--- /dev/null
+++ b/users/bocaj/rgb_matrix_stuff.h
@@ -0,0 +1,10 @@
1#pragma once
2#include "quantum.h"
3
4bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record);
5void keyboard_post_init_rgb_matrix(void);
6void matrix_scan_rgb_matrix(void);
7
8void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
9void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type);
10void rgb_matrix_set_color_row(uint8_t row, uint8_t red, uint8_t green, uint8_t blue);
diff --git a/users/bocaj/rules.mk b/users/bocaj/rules.mk
index 9ed8c250a..a0e7e93bc 100644
--- a/users/bocaj/rules.mk
+++ b/users/bocaj/rules.mk
@@ -1,33 +1,26 @@
1SRC += bocaj.c \ 1SRC += bocaj.c \
2 process_records.c 2 process_records.c
3 3
4ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") 4LEADER_ENABLE = yes
5 SRC += secrets.c 5MOUSEKEY_ENABLE = yes
6endif 6EXTRAKEY_ENABLE = yes
7 7
8ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) 8ifneq ($(PLATFORM),CHIBIOS)
9 SRC += tap_dances.c 9 LTO_ENABLE = yes
10endif 10endif
11 11SPACE_CADET_ENABLE = no
12# Caused problems when building via docker on Mac OS 12GRAVE_ESC_ENABLE = no
13# EXTRAFLAGS += -flto 13
14 14ifneq ($(strip $(NO_SECRETS)), yes)
15ifeq ($(strip $(NO_SECRETS)), yes) 15 ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
16 OPT_DEFS += -DNO_SECRETS 16 SRC += secrets.c
17endif 17 endif
18 18 ifeq ($(strip $(NO_SECRETS)), lite)
19ifeq ($(strip $(MACROS_ENABLED)), yes) 19 OPT_DEFS += -DNO_SECRETS
20 OPT_DEFS += -DMACROS_ENABLED 20 endif
21endif
22
23ifeq ($(strip $(UCIS_ENABLE)), yes)
24 SRC += send_unicode.c
25endif
26
27ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
28 SRC += send_unicode.c
29endif 21endif
30 22
31ifeq ($(strip $(UNICODE_ENABLE)), yes) 23RGB_MATRIX_ENABLE ?= no
32 SRC += send_unicode.c 24ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
25 SRC += rgb_matrix_stuff.c
33endif 26endif
diff --git a/users/bocaj/send_unicode.c b/users/bocaj/send_unicode.c
deleted file mode 100644
index b1290f631..000000000
--- a/users/bocaj/send_unicode.c
+++ /dev/null
@@ -1,106 +0,0 @@
1// Written by konstantin: vomindoraan
2#include "send_unicode.h"
3#include <ctype.h>
4#include <string.h>
5
6__attribute__((weak))
7void send_unicode_hex_string(const char* str) {
8 if (!str) { return; } // Safety net
9
10 while (*str) {
11 // Find the next code point (token) in the string
12 for (; *str == ' '; str++);
13 size_t n = strcspn(str, " "); // Length of the current token
14 char code_point[n+1];
15 strncpy(code_point, str, n);
16 code_point[n] = '\0'; // Make sure it's null-terminated
17
18 // Normalize the code point: make all hex digits lowercase
19 for (char *p = code_point; *p; p++) {
20 *p = tolower((unsigned char)*p);
21 }
22
23 // Send the code point as a Unicode input string
24 unicode_input_start();
25 send_string(code_point);
26 unicode_input_finish();
27
28 str += n; // Move to the first ' ' (or '\0') after the current token
29 }
30}
31
32// (ノಠ痊ಠ)ノ彡┻━┻
33// send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B");
34
35//Old code
36// (╯°□°)╯ ︵ ┻━┻
37 #if 0
38 register_code(KC_RSFT);
39 tap(KC_9);
40 unregister_code(KC_RSFT);
41 process_unicode((0x256F | QK_UNICODE), record); // Arm
42 process_unicode((0x00B0 | QK_UNICODE), record); // Eye
43 process_unicode((0x25A1 | QK_UNICODE), record); // Mouth
44 process_unicode((0x00B0 | QK_UNICODE), record); // Eye
45 register_code(KC_RSFT);
46 tap(KC_0);
47 unregister_code(KC_RSFT);
48 process_unicode((0x256F | QK_UNICODE), record); // Arm
49 tap(KC_SPC);
50 process_unicode((0x0361 | QK_UNICODE), record); // Flippy
51 tap(KC_SPC);
52 process_unicode((0x253B | QK_UNICODE), record); // Table
53 process_unicode((0x2501 | QK_UNICODE), record); // Table
54 process_unicode((0x253B | QK_UNICODE), record); // Table
55 #endif
56
57
58// If you need a good converter: https://r12a.github.io/app-conversion/
59uint8_t saved_mods;
60
61void unicode_input_start (void) {
62 // save current mods
63 saved_mods = get_mods(); // Save current mods
64 clear_mods(); // Unregister mods to start from a clean state
65
66 switch(get_unicode_input_mode()) {
67 case UC_OSX:
68 register_code(KC_LALT);
69 break;
70 case UC_LNX:
71 register_code(KC_LCTL);
72 register_code(KC_LSFT);
73 register_code(KC_U);
74 unregister_code(KC_U);
75 unregister_code(KC_LSFT);
76 unregister_code(KC_LCTL);
77 break;
78 case UC_WIN:
79 register_code(KC_LALT);
80 register_code(KC_PPLS);
81 unregister_code(KC_PPLS);
82 break;
83 case UC_WINC:
84 register_code(KC_RALT);
85 unregister_code(KC_RALT);
86 register_code(KC_U);
87 unregister_code(KC_U);
88 break;
89 }
90 wait_ms(UNICODE_TYPE_DELAY);
91}
92
93void unicode_input_finish (void) {
94 switch(get_unicode_input_mode()) {
95 case UC_OSX:
96 case UC_WIN:
97 unregister_code(KC_LALT);
98 break;
99 case UC_LNX:
100 register_code(KC_SPC);
101 unregister_code(KC_SPC);
102 break;
103 }
104
105 set_mods(saved_mods); // Reregister previously set mods
106}
diff --git a/users/bocaj/send_unicode.h b/users/bocaj/send_unicode.h
deleted file mode 100644
index 818b6e571..000000000
--- a/users/bocaj/send_unicode.h
+++ /dev/null
@@ -1,71 +0,0 @@
1#pragma once
2
3#include "quantum.h"
4
5void send_unicode_hex_string(const char* str);
6
7/* use X(n) to call the */
8#ifdef UNICODEMAP_ENABLE
9enum unicode_name {
10 THINK, // thinking face 🤔
11 GRIN, // grinning face 😊
12 SMRK, // smirk 😏
13 WEARY, // good shit 😩
14 UNAMU, // unamused 😒
15
16 SNEK, // snke 🐍
17 PENGUIN, // 🐧
18 DRAGON, // 🐉
19 MONKEY, // 🐒
20 CHICK, // 🐥
21 BOAR, // 🐗
22
23 OKOK, // 👌
24 EFFU, // 🖕
25 INUP, // 👆
26 THUP, // 👍
27 THDN, // 👎
28
29 BBB, // dat B 🅱
30 POO, // poop 💩
31 HUNDR, // 100 💯
32 EGGPL, // EGGPLANT 🍆
33 WATER, // wet 💦
34 TUMBLER, // 🥃
35
36 LIT, // fire 🔥
37 BANG, // ‽
38 IRONY, // ⸮
39 DEGREE // °
40};
41
42
43const uint32_t PROGMEM unicode_map[] = {
44 [THINK] = 0x1F914,
45 [GRIN] = 0x1F600,
46 [BBB] = 0x1F171,
47 [POO] = 0x1F4A9,
48 [HUNDR] = 0x1F4AF,
49 [SMRK] = 0x1F60F,
50 [WEARY] = 0x1F629,
51 [EGGPL] = 0x1F346,
52 [WATER] = 0x1F4A6,
53 [LIT] = 0x1F525,
54 [UNAMU] = 0x1F612,
55 [SNEK] = 0x1F40D,
56 [PENGUIN] = 0x1F427,
57 [BOAR] = 0x1F417,
58 [MONKEY] = 0x1F412,
59 [CHICK] = 0x1F425,
60 [DRAGON] = 0x1F409,
61 [OKOK] = 0x1F44C,
62 [EFFU] = 0x1F595,
63 [INUP] = 0x1F446,
64 [THDN] = 0x1F44E,
65 [THUP] = 0x1F44D,
66 [TUMBLER] = 0x1F943,
67 [BANG] = 0x0203D,
68 [IRONY] = 0x02E2E,
69 [DEGREE] = 0x000B0
70 };
71#endif // UNICODEMAP_ENABLE
diff --git a/users/bocaj/tap_dances.c b/users/bocaj/tap_dances.c
deleted file mode 100644
index a9628a345..000000000
--- a/users/bocaj/tap_dances.c
+++ /dev/null
@@ -1,64 +0,0 @@
1#include "tap_dances.h"
2
3
4//define diablo macro timer variables
5uint16_t diablo_timer[4];
6uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 };
7uint8_t diablo_key_time[4];
8
9// has the correct number of seconds elapsed (as defined by diablo_times)
10bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; };
11
12// Cycle through the times for the macro, starting at 0, for disabled.
13// Max of six values, so don't exceed
14void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) {
15 if (state->count >= 7) {
16 diablo_key_time[diablo_key] = diablo_times[0];
17 reset_tap_dance(state);
18 } else {
19 diablo_key_time[diablo_key] = diablo_times[state->count - 1];
20 }
21}
22
23// Would rather have one function for all of this, but no idea how to do that...
24void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); }
25void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); }
26void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); }
27void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); }
28
29//Tap Dance Definitions
30qk_tap_dance_action_t tap_dance_actions[] = {
31 // tap once to disable, and more to enable timed micros
32 [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1),
33 [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2),
34 [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3),
35 [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4),
36};
37
38// Sends the key press to system, but only if on the Diablo layer
39void send_diablo_keystroke(uint8_t diablo_key) {
40 if (biton32(layer_state) == _DIABLO) {
41 switch (diablo_key) {
42 case 0:
43 tap(KC_1); break;
44 case 1:
45 tap(KC_2); break;
46 case 2:
47 tap(KC_3); break;
48 case 3:
49 tap(KC_4); break;
50 }
51 }
52}
53
54// Checks each of the 4 timers/keys to see if enough time has elapsed
55// Runs the "send string" command if enough time has passed, and resets the timer.
56void run_diablo_macro_check(void) {
57 uint8_t dtime;
58 for (dtime = 0; dtime < 4; dtime++) {
59 if (check_dtimer(dtime) && diablo_key_time[dtime]) {
60 diablo_timer[dtime] = timer_read();
61 send_diablo_keystroke(dtime);
62 }
63 }
64}
diff --git a/users/bocaj/tap_dances.h b/users/bocaj/tap_dances.h
deleted file mode 100644
index 5b1277ec5..000000000
--- a/users/bocaj/tap_dances.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#pragma once
2#include "bocaj.h"
3
4//define diablo macro timer variables
5extern uint16_t diablo_timer[4];
6extern uint8_t diablo_times[];
7extern uint8_t diablo_key_time[4];
8
9
10void run_diablo_macro_check(void);
11
12#ifdef TAP_DANCE_ENABLE
13enum {
14 TD_D3_1 = 0,
15 TD_D3_2,
16 TD_D3_3,
17 TD_D3_4
18};
19#endif // TAP_DANCE_ENABLE
diff --git a/users/bocaj/wrappers.h b/users/bocaj/wrappers.h
index 379edaad2..c76820f49 100644
--- a/users/bocaj/wrappers.h
+++ b/users/bocaj/wrappers.h
@@ -1,37 +1,193 @@
1#pragma once 1#pragma once
2#include "bocaj.h" 2#include "bocaj.h"
3 3
4/*
5Since our quirky block definitions are basically a list of comma separated
6arguments, we need a wrapper in order for these definitions to be
7expanded before being used as arguments to the LAYOUT_xxx macro.
8*/
4#if (!defined(LAYOUT) && defined(KEYMAP)) 9#if (!defined(LAYOUT) && defined(KEYMAP))
5#define LAYOUT KEYMAP 10# define LAYOUT KEYMAP
6#endif 11#endif
7 12
8#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) 13// clang-format off
9#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) 14#define WRAPPER_ergodox_pretty(...) LAYOUT_ergodox_pretty(__VA_ARGS__)
15#define WRAPPER_ortho_4x12(...) LAYOUT_planck_mit(__VA_ARGS__)
10 16
11#define _________________QWERTY_L1__________________ KC_Q, KC_W, KC_E, KC_R, KC_T 17/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */
12#define _________________QWERTY_L2__________________ KC_A, KC_S, GUI_CTR(0, KC_D), KC_F, KC_G 18#define WRAPPER_ergodox_bocaj( \
13#define _________________QWERTY_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B 19 L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06, \
20 L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \
21 L20,L21,L22,L23,L24,L25, R21,R22,R23,R24,R25,R26, \
22 L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36, \
23 L40,L41,L42,L43,L44, R42,R43,R44,R45,R46, \
24 L55,L56, R50,R51, \
25 L54, R52, \
26 L53,L52,L51, R55,R54,R53 ) \
27 WRAPPER_ergodox_pretty( \
28 L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \
29 L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \
30 L20, L21, SFT_T(L22), GUI_T(L23), ALT_T(L24), L25, R21, ALT_T(R22), GUI_T(R23), SFT_T(R24), R25, R26, \
31 L30, CTL_T(L31), L32, L33, L34, L35, ALL_T(L36), MEH_T(R30), R31, R32, R33, R34, CTL_T(R35), R36, \
32 L40, L41, L42, L43, L44, R42, R43, R44, R45, R46, \
33 L55,L56, /* <- LHS/RHS -> */ R50,R51, \
34 L54, /* <- LHS/RHS -> */ R52, \
35 LT(_LOWER, L53),L52,L51, /* <- LHS/RHS -> */ R55,R54,LT(_RAISE, R53) \
36)
14 37
15#define _________________QWERTY_R1__________________ KC_Y, KC_U, KC_I, KC_O, KC_P 38#define WRAPPER_ergodox_bocaj_WIN( \
16#define _________________QWERTY_R2__________________ KC_H, KC_J, GUI_CTR(0, KC_K), KC_L, KC_SCLN 39 L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06, \
17#define _________________QWERTY_R3__________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH 40 L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \
41 L20,L21,L22,L23,L24,L25, R21,R22,R23,R24,R25,R26, \
42 L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36, \
43 L40,L41,L42,L43,L44, R42,R43,R44,R45,R46, \
44 L55,L56, R50,R51, \
45 L54, R52, \
46 L53,L52,L51, R55,R54,R53 ) \
47 WRAPPER_ergodox_pretty( \
48 L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \
49 L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \
50 L20, L21, SFT_T(L22), CTL_T(L23), ALT_T(L24), L25, R21, ALT_T(R22), CTL_T(R23), SFT_T(R24), R25, R26, \
51 L30, GUI_T(L31), L32, L33, L34, L35, ALL_T(L36), MEH_T(R30), R31, R32, R33, R34, GUI_T(R35), R36, \
52 L40, L41, L42, L43, L44, R42, R43, R44, R45, R46, \
53 L55,L56, /* <- LHS/RHS -> */ R50,R51, \
54 L54, /* <- LHS/RHS -> */ R52, \
55 LT(_LOWER, L53),L52,L51, /* <- LHS/RHS -> */ R55,R54,LT(_RAISE, R53) \
56)
18 57
19// Hardware Driven Workman 58/*
20#define _________________WORKMAN_L1_________________ KC_Q, KC_D, KC_R, KC_W, KC_B 59 Planck EZ Wrappers
21#define _________________WORKMAN_L2_________________ KC_A, KC_S, GUI_CTR(0, KC_H), KC_T, KC_G // GUI_CTR(0, kc) behaves as GUI_T(kc) 60*/
22#define ________________WWORKMAN_L2_________________ KC_A, KC_S, GUI_CTR(1, KC_H), KC_T, KC_G // GUI_CTR(1, kc) behaves as CTR_T(kc) 61#define WRAPPER_planck_bocaj( \
23#define _________________WORKMAN_L3_________________ KC_Z, KC_X, KC_M, KC_C, KC_V 62 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \
63 K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
64 K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
65 K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \
66)\
67 WRAPPER_ortho_4x12( \
68 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \
69 K11, K12, SFT_T(K13), GUI_T(K14), ALT_T(K15), K16, K17, ALT_T(K18), GUI_T(K19), SFT_T(K1A), K1B, K1C, \
70 K21, CTL_T(K22), K23, K24, K25, K26, K27, K28, K29, K2A, CTL_T(K2B), K2C, \
71 K31, K32, K33, K34, LT(_LOWER, K35), K36, LT(_RAISE, K37), K38, K39, K3A, K3B )
24 72
25#define _________________WORKMAN_R1_________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN 73#define WRAPPER_planck_bocaj_WIN( \
26#define _________________WORKMAN_R2_________________ KC_Y, KC_N, GUI_CTR(0, KC_E), KC_O, KC_I // GUI_CTR(0, kc) behaves as GUI_T(kc) 74 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \
27#define ________________WWORKMAN_R2_________________ KC_Y, KC_N, GUI_CTR(1, KC_E), KC_O, KC_I // GUI_CTR(1, kc) behaves as CTR_T(kc) 75 K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
28#define _________________WORKMAN_R3_________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH 76 K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
77 K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \
78)\
79 WRAPPER_ortho_4x12( \
80 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \
81 K11, K12, SFT_T(K13), CTL_T(K14), ALT_T(K15), K16, K17, ALT_T(K18), CTL_T(K19), SFT_T(K1A), K1B, K1C, \
82 K21, GUI_T(K22), K23, K24, K25, K26, K27, K28, K29, K2A, GUI_T(K2B), K2C, \
83 K31, K32, K33, K34, LT(_LOWER, K35), K36, LT(_RAISE, K37), K38, K39, K3A, K3B )
29 84
85#define WRAPPER_planck_bocaj_base( \
86 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
87 K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
88 K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
89) \
90 WRAPPER_planck_bocaj( \
91 KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
92 KC_TAB, K11, K12, K13, K14, ALL_T(K15), MEH_T(K16), K17, K18, K19, K1A, KC_QUOT, \
93 KC_LSFT, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, _______, \
94 _______, KC_LEAD, KC_UP, KC_LEFT, KC_BSPC, KC_SPC, KC_ENTER, KC_RIGHT, KC_DOWN, QWERTY, WORKMAN \
95 )
30 96
31#define __________________NUMBER_LEFT_______________ KC_1, KC_2, KC_3, KC_4, KC_5 97#define WRAPPER_planck_bocaj_base_WIN( \
32#define __________________NUMBER_RIGHT______________ KC_6, KC_7, KC_8, KC_9, KC_0 98 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
99 K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
100 K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
101) \
102 WRAPPER_planck_bocaj_WIN( \
103 KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
104 KC_TAB, K11, K12, K13, K14, ALL_T(K15), MEH_T(K16), K17, K18, K19, K1A, KC_QUOT, \
105 KC_LSFT, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, _______, \
106 _______, KC_LEAD, KC_UP, KC_LEFT, KC_BSPC, KC_SPC, KC_ENTER, KC_RIGHT, KC_DOWN, QWERTY, WORKMAN \
107 )
33 108
34#define __________________FUNCTION_LEFT_____________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 109/*
35#define __________________FUNCTION_RIGHT____________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 110Blocks for each of the four major keyboard layouts
111Organized so we can quickly adapt and modify all of them
112at once, rather than for each keyboard, one at a time.
113And this allows for much cleaner blocks in the keymaps.
114For instance Tap/Hold for Control on all of the layouts
36 115
37#define ____________________BLANK___________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS 116NOTE: These are all the same length. If you do a search/replace
117 then you need to add/remove underscores to keep the
118 lengths consistent.
119*/
120
121#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
122#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
123#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B
124
125#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P
126#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
127#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH
128
129#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G
130#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D
131#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B
132
133#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
134#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O
135#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH
136
137#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
138#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I
139#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X
140
141#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L
142#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S
143#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z
144
145#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B
146#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G
147#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V
148
149#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN
150#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I
151#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH
152
153#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5
154#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0
155#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
156#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
157
158#define ___________________BLANK___________________ _______, _______, _______, _______, _______
159#define _________________UNDEFINED_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
160
161#define ___________________LOWER_L1_EXT____________________ KC_GRV, _______, _______, KC_UP, _______, KC_ARRW
162#define ___________________LOWER_L2_EXT____________________ KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_LPRN
163#define ___________________LOWER_L3_EXT____________________ _______, _______, _______, _______, _______, KC_LBRC
164
165#define ___________________LOWER_R1_EXT____________________ KC_MINS, KC_7, KC_8, KC_9, KC_PLUS, KC_EQUAL
166#define ___________________LOWER_R2_EXT____________________ KC_RPRN, KC_4, KC_5, KC_6, KC_ASTR, KC_BSLS
167#define ___________________LOWER_R3_EXT____________________ KC_RBRC, KC_1, KC_2, KC_3, KC_SLSH, _______
168
169// #define _________________LOWER_L1__________________ ________________NUMBER_LEFT________________
170// #define _________________LOWER_L2__________________ _______, _______, _______, _______, KC_LPRN
171// #define _________________LOWER_L3__________________ _______, _______, _______, KC_ARRW, KC_LBRC
172
173// #define _________________LOWER_R1__________________ ________________NUMBER_RIGHT_______________
174// #define _________________LOWER_R2__________________ KC_RPRN, _______, _______, _______, _______
175// #define _________________LOWER_R3__________________ KC_RBRC, _______, _______, _______, _______
176
177#define _________________RAISE_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC
178#define _________________RAISE_L2__________________ _________________FUNC_LEFT_________________
179#define _________________RAISE_L3__________________ ___________________BLANK___________________
180
181#define _________________RAISE_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN
182#define _________________RAISE_R2__________________ _________________FUNC_RIGHT________________
183#define _________________RAISE_R3__________________ ___________________BLANK___________________
184
185#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG
186#define _________________ADJUST_L2_________________ KC__MUTE, KC__VOLDOWN, KC__VOLUP, _______, KC_MNXT
187#define _________________ADJUST_L3_________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T
188
189#define _________________ADJUST_R1_________________ ___________________BLANK___________________
190#define _________________ADJUST_R2_________________ CG_SWAP, WORKMAN, QWERTY, _______, _______
191#define _________________ADJUST_R3_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, CG_NORM
192
193// clang-format on