aboutsummaryrefslogtreecommitdiff
path: root/layouts/community/ergodox/bocaj/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/community/ergodox/bocaj/keymap.c')
-rw-r--r--layouts/community/ergodox/bocaj/keymap.c175
1 files changed, 0 insertions, 175 deletions
diff --git a/layouts/community/ergodox/bocaj/keymap.c b/layouts/community/ergodox/bocaj/keymap.c
deleted file mode 100644
index ba105a8f1..000000000
--- a/layouts/community/ergodox/bocaj/keymap.c
+++ /dev/null
@@ -1,175 +0,0 @@
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/*
21 * The `LAYOUT_ergodox_pretty_base` macro is a template to allow the use of
22 * identical modifiers for the default layouts (eg QWERTY, Colemak, Dvorak,
23 * etc), so that there is no need to set them up for each layout, and modify
24 * all of them if I want to change them. This helps to keep consistency and
25 * ease of use. K## is a placeholder to pass through the individual keycodes
26 */
27#define LAYOUT_ergodox_bocaj(...) WRAPPER_ergodox_bocaj(__VA_ARGS__)
28#define LAYOUT_ergodox_bocaj_WIN(...) WRAPPER_ergodox_bocaj_WIN(__VA_ARGS__)
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31
32 [_WORKMAN] = LAYOUT_ergodox_bocaj(
33 KC_ESC, ________________NUMBER_LEFT________________, KC_ARRW, KC_MINS, ________________NUMBER_RIGHT_______________, KC_EQUAL,
34 KC_DEL, _________________WORKMAN_L1________________, KC_LPRN, KC_RPRN, _________________WORKMAN_R1________________, KC_BSLS,
35 _______, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
36 KC_LSFT, _________________WORKMAN_L3________________, KC_LBRC, KC_RBRC, _________________WORKMAN_R3________________, _______,
37 MO_MOD, KC_PGUP, KC_HOME, KC_UP, KC_LEFT, KC_RIGHT, KC_DOWN, KC_END, KC_PGDN, WORKMAN,
38 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
39 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
40 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
41 ),
42
43 [_WWORKMAN] = LAYOUT_ergodox_bocaj_WIN(
44 KC_ESC, ________________NUMBER_LEFT________________, KC_ARRW, KC_MINS, ________________NUMBER_RIGHT_______________, KC_EQUAL,
45 KC_DEL, _________________WORKMAN_L1________________, KC_LPRN, KC_RPRN, _________________WORKMAN_R1________________, KC_BSLS,
46 _______, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
47 KC_LSFT, _________________WORKMAN_L3________________, KC_LBRC, KC_RBRC, _________________WORKMAN_R3________________, _______,
48 MO_MOD, KC_PGUP, KC_HOME, KC_UP, KC_LEFT, KC_RIGHT, KC_DOWN, KC_END, KC_PGDN, WORKMAN,
49 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
50 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
51 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
52 ),
53
54 [_LOWER] = LAYOUT_ergodox_bocaj(
55 KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
56 _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_BSLS, _______,
57 _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_4, KC_5, KC_6, KC_ASTR, _______,
58 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_PLUS, _______,
59 _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_COMM, KC_MINS, _______,
60 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
61 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
62 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
63 ),
64
65 [_RAISE] = LAYOUT_ergodox_bocaj(
66 KC_TILD, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, _______,
67 KC_F11, _________________RAISE_L2__________________, _______, _______, _________________RAISE_R2__________________, KC_F12,
68 _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
69 _______, _______, KC_MRWD, KC_MPLY, KC_MFFD, _______, _______, _______, ___________________BLANK___________________, _______,
70 ___________________BLANK___________________, ___________________BLANK___________________,
71 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
72 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
73 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
74 ),
75
76 [_ADJUST] = LAYOUT_ergodox_pretty(
77 KC_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RST,
78 VRSN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST,
79 _______, KC__MUTE, KC__VOLDOWN, KC__VOLUP, _______, KC_MNXT, _______, _______, _______, _______, _______, _______,
80 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
81 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
82 KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC,
83 KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN,
84 KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER
85 ),
86
87 // Wrapping Mouse-Wheel Keys with `X_T()` style functions seems
88 // to break the mouse button. So we can't use the wrapper here.
89 [_MOD] = LAYOUT_ergodox_pretty(
90 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
91 _______, _______, _______, KC_WH_D, _______, _______, _______, _______, _______, _______, KC_MS_U, _______, _______, _______,
92 _______, _______, KC_WH_L, KC_WH_U, KC_WH_R, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______,
93 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
94 _______, _______, _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______,
95 _______,_______, /* <- LHS/RHS -> */ _______,_______,
96 _______, /* <- LHS/RHS -> */ _______,
97 KC_BTN1,KC_BTN2,_______, /* <- LHS/RHS -> */ _______,KC_BTN3,KC_BTN4
98 )
99
100};
101// clang-format on
102
103bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
104 return true;
105}
106
107void matrix_init_keymap(void) {};
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
142void matrix_scan_keymap(void) {
143 uint8_t modifiers = get_mods();
144 uint8_t led_usb_state = host_keyboard_leds();
145 uint8_t one_shot = get_oneshot_mods();
146 uint8_t layer_is_workman = layer_state_is(_WORKMAN);
147
148 if ((modifiers) && (layer_is_workman)) {
149 if (modifiers & MODS_SHIFT_MASK || led_usb_state & (1<<USB_LED_CAPS_LOCK) || one_shot & MODS_SHIFT_MASK) {
150 ergodox_right_led_1_on();
151 ergodox_right_led_1_set( 25 );
152 } else {
153 ergodox_right_led_1_off();
154 }
155 if ((modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) && (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK)) {
156 ergodox_right_led_2_on();
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 );
167 } else {
168 ergodox_right_led_3_off();
169 }
170 } else if (!(modifiers) && (layer_is_workman)) {
171 ergodox_right_led_1_off();
172 ergodox_right_led_2_off();
173 ergodox_right_led_3_off();
174 }
175};