aboutsummaryrefslogtreecommitdiff
path: root/keyboards/aleblazer/zodiark/keymaps
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/aleblazer/zodiark/keymaps')
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/default/config.h22
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/default/keymap.c329
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/default/rules.mk1
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/slimoled/config.h22
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/slimoled/keymap.c332
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/slimoled/rules.mk1
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/via/config.h22
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/via/encoder.c36
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/via/keymap.c52
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/via/oled.c79
-rw-r--r--keyboards/aleblazer/zodiark/keymaps/via/rules.mk2
11 files changed, 898 insertions, 0 deletions
diff --git a/keyboards/aleblazer/zodiark/keymaps/default/config.h b/keyboards/aleblazer/zodiark/keymaps/default/config.h
new file mode 100644
index 000000000..2e8732ecc
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/default/config.h
@@ -0,0 +1,22 @@
1/*
2Copyright 2021 Spencer Deven <[email protected]>
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 3 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#pragma once
18
19#ifdef OLED_ENABLE
20 #define OLED_DISPLAY_128X64
21 #define OLED_TIMEOUT 400000
22#endif
diff --git a/keyboards/aleblazer/zodiark/keymaps/default/keymap.c b/keyboards/aleblazer/zodiark/keymaps/default/keymap.c
new file mode 100644
index 000000000..c6a81c67f
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/default/keymap.c
@@ -0,0 +1,329 @@
1/*
2Copyright 2021 Spencer Deven <[email protected]>
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 3 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14#include QMK_KEYBOARD_H
15
16enum sofle_layers {
17 /* _M_XYZ = Mac Os, _W_XYZ = Win/Linux */
18 _QWERTY,
19 _COLEMAK,
20 _LOWER,
21 _RAISE,
22 _ADJUST,
23};
24
25enum custom_keycodes {
26 KC_QWERTY = SAFE_RANGE,
27 KC_COLEMAK,
28 KC_LOWER,
29 KC_RAISE,
30 KC_ADJUST,
31 KC_PRVWD,
32 KC_NXTWD,
33 KC_LSTRT,
34 KC_LEND,
35 KC_DLINE
36};
37
38const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
39
40 [_QWERTY] = LAYOUT(
41 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
42 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
43 KC_ADJUST, KC_A, KC_S, KC_D, KC_F, KC_G, KC_MINS, KC_EQL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
44 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_MUTE, RGB_TOG, KC_DEL,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
45 KC_LCTL, KC_LALT, KC_LGUI, LALT(KC_TAB), KC_LOWER, KC_SPC, KC_ENT, KC_ENT, KC_SPC, KC_RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
46 ),
47
48 [_LOWER] = LAYOUT(
49 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
50 KC_PSLS, KC_P7, KC_P8, KC_P9, KC_NLCK, _______, _______, _______, _______, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_F12,
51 KC_CAPS, KC_P4, KC_P5, KC_P6, KC_NLCK, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_NLCK,
52 _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______,
53 _______, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______
54 ),
55
56 [_RAISE] = LAYOUT(
57 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
58 KC_PSLS, KC_P7, KC_P8, KC_P9, KC_NLCK, _______, _______, _______, _______, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_F12,
59 KC_CAPS, KC_P4, KC_P5, KC_P6, KC_NLCK, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_NLCK,
60 _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______,
61 _______, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______
62 ),
63
64 [_ADJUST] = LAYOUT(
65 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
66 _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, _______, _______, _______, KC_F12,
67 _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, _______, _______,
68 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI,
69 _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD
70 )
71
72};
73#ifdef OLED_ENABLE
74
75static void render_logo(void) {
76 static const char PROGMEM qmk_logo[] = {
77 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
78 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
79 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
80 };
81
82 oled_write_P(qmk_logo, false);
83}
84
85static void print_status_narrow(void) {
86 // Print current mode
87 oled_write_P(PSTR("\n\n"), false);
88 oled_write_ln_P(PSTR("MODE"), false);
89 oled_write_ln_P(PSTR(""), false);
90 if (keymap_config.swap_lctl_lgui) {
91 oled_write_ln_P(PSTR("MAC"), false);
92 } else {
93 oled_write_ln_P(PSTR("WIN"), false);
94 }
95
96 switch (get_highest_layer(default_layer_state)) {
97 case _QWERTY:
98 oled_write_ln_P(PSTR("Qwrt"), false);
99 break;
100 case _COLEMAK:
101 oled_write_ln_P(PSTR("Clmk"), false);
102 break;
103 default:
104 oled_write_P(PSTR("Undef"), false);
105 }
106 oled_write_P(PSTR("\n\n"), false);
107 // Print current layer
108 oled_write_ln_P(PSTR("LAYER"), false);
109 switch (get_highest_layer(layer_state)) {
110 case _COLEMAK:
111 case _QWERTY:
112 oled_write_P(PSTR("Base\n"), false);
113 break;
114 case _RAISE:
115 oled_write_P(PSTR("Raise"), false);
116 break;
117 case _LOWER:
118 oled_write_P(PSTR("Lower"), false);
119 break;
120 case _ADJUST:
121 oled_write_P(PSTR("Adj\n"), false);
122 break;
123 default:
124 oled_write_ln_P(PSTR("Undef"), false);
125 }
126 oled_write_P(PSTR("\n\n"), false);
127 led_t led_usb_state = host_keyboard_led_state();
128 oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
129}
130
131oled_rotation_t oled_init_user(oled_rotation_t rotation) {
132 if (is_keyboard_master()) {
133 return OLED_ROTATION_90;
134 }
135 return rotation;
136}
137
138bool oled_task_user(void) {
139 if (is_keyboard_master()) {
140 print_status_narrow();
141 } else {
142 render_logo();
143 }
144 return false;
145}
146
147#endif
148
149bool process_record_user(uint16_t keycode, keyrecord_t *record) {
150 switch (keycode) {
151 case KC_QWERTY:
152 if (record->event.pressed) {
153 set_single_persistent_default_layer(_QWERTY);
154 }
155 return false;
156 case KC_COLEMAK:
157 if (record->event.pressed) {
158 set_single_persistent_default_layer(_COLEMAK);
159 }
160 return false;
161 case KC_LOWER:
162 if (record->event.pressed) {
163 layer_on(_LOWER);
164 update_tri_layer(_LOWER, _RAISE, _ADJUST);
165 } else {
166 layer_off(_LOWER);
167 update_tri_layer(_LOWER, _RAISE, _ADJUST);
168 }
169 return false;
170 case KC_RAISE:
171 if (record->event.pressed) {
172 layer_on(_RAISE);
173 update_tri_layer(_LOWER, _RAISE, _ADJUST);
174 } else {
175 layer_off(_RAISE);
176 update_tri_layer(_LOWER, _RAISE, _ADJUST);
177 }
178 return false;
179 case KC_ADJUST:
180 if (record->event.pressed) {
181 layer_on(_ADJUST);
182 } else {
183 layer_off(_ADJUST);
184 }
185 return false;
186 case KC_PRVWD:
187 if (record->event.pressed) {
188 if (keymap_config.swap_lctl_lgui) {
189 register_mods(mod_config(MOD_LALT));
190 register_code(KC_LEFT);
191 } else {
192 register_mods(mod_config(MOD_LCTL));
193 register_code(KC_LEFT);
194 }
195 } else {
196 if (keymap_config.swap_lctl_lgui) {
197 unregister_mods(mod_config(MOD_LALT));
198 unregister_code(KC_LEFT);
199 } else {
200 unregister_mods(mod_config(MOD_LCTL));
201 unregister_code(KC_LEFT);
202 }
203 }
204 break;
205 case KC_NXTWD:
206 if (record->event.pressed) {
207 if (keymap_config.swap_lctl_lgui) {
208 register_mods(mod_config(MOD_LALT));
209 register_code(KC_RIGHT);
210 } else {
211 register_mods(mod_config(MOD_LCTL));
212 register_code(KC_RIGHT);
213 }
214 } else {
215 if (keymap_config.swap_lctl_lgui) {
216 unregister_mods(mod_config(MOD_LALT));
217 unregister_code(KC_RIGHT);
218 } else {
219 unregister_mods(mod_config(MOD_LCTL));
220 unregister_code(KC_RIGHT);
221 }
222 }
223 break;
224 case KC_LSTRT:
225 if (record->event.pressed) {
226 if (keymap_config.swap_lctl_lgui) {
227 //CMD-arrow on Mac, but we have CTL and GUI swapped
228 register_mods(mod_config(MOD_LCTL));
229 register_code(KC_LEFT);
230 } else {
231 register_code(KC_HOME);
232 }
233 } else {
234 if (keymap_config.swap_lctl_lgui) {
235 unregister_mods(mod_config(MOD_LCTL));
236 unregister_code(KC_LEFT);
237 } else {
238 unregister_code(KC_HOME);
239 }
240 }
241 break;
242 case KC_LEND:
243 if (record->event.pressed) {
244 if (keymap_config.swap_lctl_lgui) {
245 //CMD-arrow on Mac, but we have CTL and GUI swapped
246 register_mods(mod_config(MOD_LCTL));
247 register_code(KC_RIGHT);
248 } else {
249 register_code(KC_END);
250 }
251 } else {
252 if (keymap_config.swap_lctl_lgui) {
253 unregister_mods(mod_config(MOD_LCTL));
254 unregister_code(KC_RIGHT);
255 } else {
256 unregister_code(KC_END);
257 }
258 }
259 break;
260 case KC_DLINE:
261 if (record->event.pressed) {
262 register_mods(mod_config(MOD_LCTL));
263 register_code(KC_BSPC);
264 } else {
265 unregister_mods(mod_config(MOD_LCTL));
266 unregister_code(KC_BSPC);
267 }
268 break;
269 case KC_COPY:
270 if (record->event.pressed) {
271 register_mods(mod_config(MOD_LCTL));
272 register_code(KC_C);
273 } else {
274 unregister_mods(mod_config(MOD_LCTL));
275 unregister_code(KC_C);
276 }
277 return false;
278 case KC_PASTE:
279 if (record->event.pressed) {
280 register_mods(mod_config(MOD_LCTL));
281 register_code(KC_V);
282 } else {
283 unregister_mods(mod_config(MOD_LCTL));
284 unregister_code(KC_V);
285 }
286 return false;
287 case KC_CUT:
288 if (record->event.pressed) {
289 register_mods(mod_config(MOD_LCTL));
290 register_code(KC_X);
291 } else {
292 unregister_mods(mod_config(MOD_LCTL));
293 unregister_code(KC_X);
294 }
295 return false;
296 break;
297 case KC_UNDO:
298 if (record->event.pressed) {
299 register_mods(mod_config(MOD_LCTL));
300 register_code(KC_Z);
301 } else {
302 unregister_mods(mod_config(MOD_LCTL));
303 unregister_code(KC_Z);
304 }
305 return false;
306 }
307 return true;
308}
309
310#ifdef ENCODER_ENABLE
311
312bool encoder_update_user(uint8_t index, bool clockwise) {
313 if (index == 0) {
314 if (clockwise) {
315 tap_code(KC_VOLU);
316 } else {
317 tap_code(KC_VOLD);
318 }
319 } else if (index == 1) {
320 if (clockwise) {
321 rgblight_step();
322 } else {
323 rgblight_step_reverse();
324 }
325 }
326 return true;
327}
328
329#endif
diff --git a/keyboards/aleblazer/zodiark/keymaps/default/rules.mk b/keyboards/aleblazer/zodiark/keymaps/default/rules.mk
new file mode 100644
index 000000000..1e3cebb14
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/default/rules.mk
@@ -0,0 +1 @@
RGBLIGHT_ENABLE = yes
diff --git a/keyboards/aleblazer/zodiark/keymaps/slimoled/config.h b/keyboards/aleblazer/zodiark/keymaps/slimoled/config.h
new file mode 100644
index 000000000..e2df253c3
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/slimoled/config.h
@@ -0,0 +1,22 @@
1/*
2Copyright 2021 Spencer Deven <[email protected]>
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 3 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#pragma once
18
19#ifdef OLED_ENABLE
20 #define OLED_DISPLAY_128X32
21 #define OLED_TIMEOUT 400000
22#endif
diff --git a/keyboards/aleblazer/zodiark/keymaps/slimoled/keymap.c b/keyboards/aleblazer/zodiark/keymaps/slimoled/keymap.c
new file mode 100644
index 000000000..ca8f91f1d
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/slimoled/keymap.c
@@ -0,0 +1,332 @@
1/*
2Copyright 2021 Spencer Deven <[email protected]>
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 3 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#include QMK_KEYBOARD_H
18
19enum sofle_layers {
20 /* _M_XYZ = Mac Os, _W_XYZ = Win/Linux */
21 _QWERTY,
22 _COLEMAK,
23 _LOWER,
24 _RAISE,
25 _ADJUST,
26};
27
28enum custom_keycodes {
29 KC_QWERTY = SAFE_RANGE,
30 KC_COLEMAK,
31 KC_LOWER,
32 KC_RAISE,
33 KC_ADJUST,
34 KC_PRVWD,
35 KC_NXTWD,
36 KC_LSTRT,
37 KC_LEND,
38 KC_DLINE
39};
40
41const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42
43 [_QWERTY] = LAYOUT(
44 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
45 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
46 KC_ADJUST, KC_A, KC_S, KC_D, KC_F, KC_G, KC_MINS, KC_EQL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
47 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_MUTE, RGB_TOG, KC_DEL,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
48 KC_LCTL, KC_LALT, KC_LGUI, LALT(KC_TAB), KC_LOWER, KC_SPC, KC_ENT, KC_ENT, KC_SPC, KC_RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
49 ),
50
51 [_LOWER] = LAYOUT(
52 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
53 KC_PSLS, KC_P7, KC_P8, KC_P9, KC_NLCK, _______, _______, _______, _______, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_F12,
54 KC_CAPS, KC_P4, KC_P5, KC_P6, KC_NLCK, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_NLCK,
55 _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______,
56 _______, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______
57 ),
58
59 [_RAISE] = LAYOUT(
60 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
61 KC_PSLS, KC_P7, KC_P8, KC_P9, KC_NLCK, _______, _______, _______, _______, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_F12,
62 KC_CAPS, KC_P4, KC_P5, KC_P6, KC_NLCK, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_NLCK,
63 _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______,
64 _______, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______
65 ),
66
67 [_ADJUST] = LAYOUT(
68 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
69 _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, _______, _______, _______, KC_F12,
70 _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, _______, _______,
71 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI,
72 _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD
73 )
74
75};
76#ifdef OLED_ENABLE
77
78static void render_logo(void) {
79 static const char PROGMEM qmk_logo[] = {
80 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
81 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
82 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
83 };
84
85 oled_write_P(qmk_logo, false);
86}
87
88static void print_status_narrow(void) {
89 // Print current mode
90 oled_write_P(PSTR("\n\n"), false);
91 oled_write_ln_P(PSTR("MODE"), false);
92 oled_write_ln_P(PSTR(""), false);
93 if (keymap_config.swap_lctl_lgui) {
94 oled_write_ln_P(PSTR("MAC"), false);
95 } else {
96 oled_write_ln_P(PSTR("WIN"), false);
97 }
98
99 switch (get_highest_layer(default_layer_state)) {
100 case _QWERTY:
101 oled_write_ln_P(PSTR("Qwrt"), false);
102 break;
103 case _COLEMAK:
104 oled_write_ln_P(PSTR("Clmk"), false);
105 break;
106 default:
107 oled_write_P(PSTR("Undef"), false);
108 }
109 oled_write_P(PSTR("\n\n"), false);
110 // Print current layer
111 oled_write_ln_P(PSTR("LAYER"), false);
112 switch (get_highest_layer(layer_state)) {
113 case _COLEMAK:
114 case _QWERTY:
115 oled_write_P(PSTR("Base\n"), false);
116 break;
117 case _RAISE:
118 oled_write_P(PSTR("Raise"), false);
119 break;
120 case _LOWER:
121 oled_write_P(PSTR("Lower"), false);
122 break;
123 case _ADJUST:
124 oled_write_P(PSTR("Adj\n"), false);
125 break;
126 default:
127 oled_write_ln_P(PSTR("Undef"), false);
128 }
129 oled_write_P(PSTR("\n\n"), false);
130 led_t led_usb_state = host_keyboard_led_state();
131 oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
132}
133
134oled_rotation_t oled_init_user(oled_rotation_t rotation) {
135 if (is_keyboard_master()) {
136 return OLED_ROTATION_90;
137 }
138 return rotation;
139}
140
141bool oled_task_user(void) {
142 if (is_keyboard_master()) {
143 print_status_narrow();
144 } else {
145 render_logo();
146 }
147 return false;
148}
149
150#endif
151
152bool process_record_user(uint16_t keycode, keyrecord_t *record) {
153 switch (keycode) {
154 case KC_QWERTY:
155 if (record->event.pressed) {
156 set_single_persistent_default_layer(_QWERTY);
157 }
158 return false;
159 case KC_COLEMAK:
160 if (record->event.pressed) {
161 set_single_persistent_default_layer(_COLEMAK);
162 }
163 return false;
164 case KC_LOWER:
165 if (record->event.pressed) {
166 layer_on(_LOWER);
167 update_tri_layer(_LOWER, _RAISE, _ADJUST);
168 } else {
169 layer_off(_LOWER);
170 update_tri_layer(_LOWER, _RAISE, _ADJUST);
171 }
172 return false;
173 case KC_RAISE:
174 if (record->event.pressed) {
175 layer_on(_RAISE);
176 update_tri_layer(_LOWER, _RAISE, _ADJUST);
177 } else {
178 layer_off(_RAISE);
179 update_tri_layer(_LOWER, _RAISE, _ADJUST);
180 }
181 return false;
182 case KC_ADJUST:
183 if (record->event.pressed) {
184 layer_on(_ADJUST);
185 } else {
186 layer_off(_ADJUST);
187 }
188 return false;
189 case KC_PRVWD:
190 if (record->event.pressed) {
191 if (keymap_config.swap_lctl_lgui) {
192 register_mods(mod_config(MOD_LALT));
193 register_code(KC_LEFT);
194 } else {
195 register_mods(mod_config(MOD_LCTL));
196 register_code(KC_LEFT);
197 }
198 } else {
199 if (keymap_config.swap_lctl_lgui) {
200 unregister_mods(mod_config(MOD_LALT));
201 unregister_code(KC_LEFT);
202 } else {
203 unregister_mods(mod_config(MOD_LCTL));
204 unregister_code(KC_LEFT);
205 }
206 }
207 break;
208 case KC_NXTWD:
209 if (record->event.pressed) {
210 if (keymap_config.swap_lctl_lgui) {
211 register_mods(mod_config(MOD_LALT));
212 register_code(KC_RIGHT);
213 } else {
214 register_mods(mod_config(MOD_LCTL));
215 register_code(KC_RIGHT);
216 }
217 } else {
218 if (keymap_config.swap_lctl_lgui) {
219 unregister_mods(mod_config(MOD_LALT));
220 unregister_code(KC_RIGHT);
221 } else {
222 unregister_mods(mod_config(MOD_LCTL));
223 unregister_code(KC_RIGHT);
224 }
225 }
226 break;
227 case KC_LSTRT:
228 if (record->event.pressed) {
229 if (keymap_config.swap_lctl_lgui) {
230 //CMD-arrow on Mac, but we have CTL and GUI swapped
231 register_mods(mod_config(MOD_LCTL));
232 register_code(KC_LEFT);
233 } else {
234 register_code(KC_HOME);
235 }
236 } else {
237 if (keymap_config.swap_lctl_lgui) {
238 unregister_mods(mod_config(MOD_LCTL));
239 unregister_code(KC_LEFT);
240 } else {
241 unregister_code(KC_HOME);
242 }
243 }
244 break;
245 case KC_LEND:
246 if (record->event.pressed) {
247 if (keymap_config.swap_lctl_lgui) {
248 //CMD-arrow on Mac, but we have CTL and GUI swapped
249 register_mods(mod_config(MOD_LCTL));
250 register_code(KC_RIGHT);
251 } else {
252 register_code(KC_END);
253 }
254 } else {
255 if (keymap_config.swap_lctl_lgui) {
256 unregister_mods(mod_config(MOD_LCTL));
257 unregister_code(KC_RIGHT);
258 } else {
259 unregister_code(KC_END);
260 }
261 }
262 break;
263 case KC_DLINE:
264 if (record->event.pressed) {
265 register_mods(mod_config(MOD_LCTL));
266 register_code(KC_BSPC);
267 } else {
268 unregister_mods(mod_config(MOD_LCTL));
269 unregister_code(KC_BSPC);
270 }
271 break;
272 case KC_COPY:
273 if (record->event.pressed) {
274 register_mods(mod_config(MOD_LCTL));
275 register_code(KC_C);
276 } else {
277 unregister_mods(mod_config(MOD_LCTL));
278 unregister_code(KC_C);
279 }
280 return false;
281 case KC_PASTE:
282 if (record->event.pressed) {
283 register_mods(mod_config(MOD_LCTL));
284 register_code(KC_V);
285 } else {
286 unregister_mods(mod_config(MOD_LCTL));
287 unregister_code(KC_V);
288 }
289 return false;
290 case KC_CUT:
291 if (record->event.pressed) {
292 register_mods(mod_config(MOD_LCTL));
293 register_code(KC_X);
294 } else {
295 unregister_mods(mod_config(MOD_LCTL));
296 unregister_code(KC_X);
297 }
298 return false;
299 break;
300 case KC_UNDO:
301 if (record->event.pressed) {
302 register_mods(mod_config(MOD_LCTL));
303 register_code(KC_Z);
304 } else {
305 unregister_mods(mod_config(MOD_LCTL));
306 unregister_code(KC_Z);
307 }
308 return false;
309 }
310 return true;
311}
312
313#ifdef ENCODER_ENABLE
314
315bool encoder_update_user(uint8_t index, bool clockwise) {
316 if (index == 0) {
317 if (clockwise) {
318 tap_code(KC_VOLU);
319 } else {
320 tap_code(KC_VOLD);
321 }
322 } else if (index == 1) {
323 if (clockwise) {
324 rgblight_step();
325 } else {
326 rgblight_step_reverse();
327 }
328 }
329 return true;
330}
331
332#endif
diff --git a/keyboards/aleblazer/zodiark/keymaps/slimoled/rules.mk b/keyboards/aleblazer/zodiark/keymaps/slimoled/rules.mk
new file mode 100644
index 000000000..1e3cebb14
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/slimoled/rules.mk
@@ -0,0 +1 @@
RGBLIGHT_ENABLE = yes
diff --git a/keyboards/aleblazer/zodiark/keymaps/via/config.h b/keyboards/aleblazer/zodiark/keymaps/via/config.h
new file mode 100644
index 000000000..2e8732ecc
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/via/config.h
@@ -0,0 +1,22 @@
1/*
2Copyright 2021 Spencer Deven <[email protected]>
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 3 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#pragma once
18
19#ifdef OLED_ENABLE
20 #define OLED_DISPLAY_128X64
21 #define OLED_TIMEOUT 400000
22#endif
diff --git a/keyboards/aleblazer/zodiark/keymaps/via/encoder.c b/keyboards/aleblazer/zodiark/keymaps/via/encoder.c
new file mode 100644
index 000000000..c08cfed5c
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/via/encoder.c
@@ -0,0 +1,36 @@
1/*
2Copyright 2021 Spencer Deven <[email protected]>
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 3 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14
15//Setting up what encoder rotation does. If your encoder can be pressed as a button, that function can be set in Via.
16
17#ifdef ENCODER_ENABLE
18
19bool encoder_update_user(uint8_t index, bool clockwise) {
20 if (index == 0) {
21 if (clockwise) {
22 tap_code(KC_VOLU);
23 } else {
24 tap_code(KC_VOLD);
25 }
26 } else if (index == 1) {
27 if (clockwise) {
28 tap_code(KC_PGDOWN);
29 } else {
30 tap_code(KC_PGUP);
31 }
32 }
33 return true;
34}
35
36#endif
diff --git a/keyboards/aleblazer/zodiark/keymaps/via/keymap.c b/keyboards/aleblazer/zodiark/keymaps/via/keymap.c
new file mode 100644
index 000000000..1159afb43
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/via/keymap.c
@@ -0,0 +1,52 @@
1/*
2Copyright 2021 Spencer Deven <[email protected]>
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 3 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14#include QMK_KEYBOARD_H
15#include "oled.c"
16#include "encoder.c"
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19
20 [0] = LAYOUT(
21 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
22 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
23 MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, KC_MINS, KC_EQL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
24 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_MUTE, RGB_TOG, KC_DEL,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
25 KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(1), KC_SPC, KC_ENT, KC_ENT, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
26 ),
27
28 [1] = LAYOUT(
29 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
30 KC_PSLS, KC_P7, KC_P8, KC_P9, KC_NLCK, _______, _______, _______, _______, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_F12,
31 KC_CAPS, KC_P4, KC_P5, KC_P6, KC_NLCK, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_NLCK,
32 _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______,
33 _______, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______
34 ),
35
36 [2] = LAYOUT(
37 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
38 KC_PSLS, KC_P7, KC_P8, KC_P9, KC_NLCK, _______, _______, _______, _______, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_F12,
39 KC_CAPS, KC_P4, KC_P5, KC_P6, KC_NLCK, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_NLCK,
40 _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______,
41 _______, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______
42 ),
43
44 [3] = LAYOUT(
45 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
46 _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, _______, _______, _______, KC_F12,
47 _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, _______, _______,
48 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI,
49 _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD
50 )
51
52};
diff --git a/keyboards/aleblazer/zodiark/keymaps/via/oled.c b/keyboards/aleblazer/zodiark/keymaps/via/oled.c
new file mode 100644
index 000000000..8642bacb0
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/via/oled.c
@@ -0,0 +1,79 @@
1/*
2Copyright 2021 Spencer Deven <[email protected]>
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 3 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14
15#ifdef OLED_ENABLE
16
17static void render_logo(void) {
18 static const char PROGMEM qmk_logo[] = {
19 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
20 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
21 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
22 };
23
24 oled_write_P(qmk_logo, false);
25}
26
27static void print_status_narrow(void) {
28 // Print current mode
29 oled_write_P(PSTR("\n\n"), false);
30
31 switch (get_highest_layer(layer_state)) {
32 case 0:
33 oled_write_ln_P(PSTR("Qwrt"), false);
34 break;
35 default:
36 oled_write_P(PSTR("Mod\n"), false);
37 break;
38 }
39 oled_write_P(PSTR("\n\n"), false);
40 // Print current layer
41 oled_write_ln_P(PSTR("LAYER"), false);
42 switch (get_highest_layer(layer_state)) {
43 case 0:
44 oled_write_P(PSTR("Base\n"), false);
45 break;
46 case 1:
47 oled_write_P(PSTR("Raise"), false);
48 break;
49 case 2:
50 oled_write_P(PSTR("Lower"), false);
51 break;
52 case 3:
53 oled_write_P(PSTR("Adjust"), false);
54 break;
55 default:
56 oled_write_ln_P(PSTR("Undef"), false);
57 }
58 oled_write_P(PSTR("\n\n"), false);
59 led_t led_usb_state = host_keyboard_led_state();
60 oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
61}
62
63oled_rotation_t oled_init_user(oled_rotation_t rotation) {
64 if (is_keyboard_master()) {
65 return OLED_ROTATION_90;
66 }
67 return rotation;
68}
69
70bool oled_task_user(void) {
71 if (is_keyboard_master()) {
72 print_status_narrow();
73 } else {
74 render_logo();
75 }
76 return false;
77}
78
79#endif
diff --git a/keyboards/aleblazer/zodiark/keymaps/via/rules.mk b/keyboards/aleblazer/zodiark/keymaps/via/rules.mk
new file mode 100644
index 000000000..76d3c49ff
--- /dev/null
+++ b/keyboards/aleblazer/zodiark/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
1RGBLIGHT_ENABLE = yes
2VIA_ENABLE = yes