diff options
20 files changed, 295 insertions, 113 deletions
diff --git a/keyboards/doro67/multi/keymaps/konstantin/config.h b/keyboards/doro67/multi/keymaps/konstantin/config.h index 1d12c7db3..3c2583e2d 100644 --- a/keyboards/doro67/multi/keymaps/konstantin/config.h +++ b/keyboards/doro67/multi/keymaps/konstantin/config.h | |||
@@ -1,6 +1,4 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #define DYNAMIC_KEYMAP_LAYER_COUNT 3 | ||
4 | |||
5 | #define LAYER_FN | 3 | #define LAYER_FN |
6 | #define LAYER_NUMPAD | 4 | #define LAYER_NUMPAD |
diff --git a/keyboards/doro67/multi/keymaps/konstantin/rules.mk b/keyboards/doro67/multi/keymaps/konstantin/rules.mk index 9abe61915..10ff0bc91 100644 --- a/keyboards/doro67/multi/keymaps/konstantin/rules.mk +++ b/keyboards/doro67/multi/keymaps/konstantin/rules.mk | |||
@@ -1,5 +1,5 @@ | |||
1 | # Generic features | 1 | # Generic features |
2 | BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite | 2 | BOOTMAGIC_ENABLE = yes |
3 | COMMAND_ENABLE = yes | 3 | COMMAND_ENABLE = yes |
4 | CONSOLE_ENABLE = yes | 4 | CONSOLE_ENABLE = yes |
5 | EXTRAKEY_ENABLE = yes | 5 | EXTRAKEY_ENABLE = yes |
diff --git a/keyboards/dz60/keymaps/konstantin_b/rules.mk b/keyboards/dz60/keymaps/konstantin_b/rules.mk index 6006b7263..c1eb43da2 100644 --- a/keyboards/dz60/keymaps/konstantin_b/rules.mk +++ b/keyboards/dz60/keymaps/konstantin_b/rules.mk | |||
@@ -1,13 +1,21 @@ | |||
1 | BACKLIGHT_ENABLE = no | 1 | USER_NAME := konstantin |
2 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | 2 | |
3 | # Generic features | ||
4 | BOOTMAGIC_ENABLE = yes | ||
3 | COMMAND_ENABLE = yes | 5 | COMMAND_ENABLE = yes |
4 | CONSOLE_ENABLE = yes | 6 | CONSOLE_ENABLE = yes |
5 | EXTRAKEY_ENABLE = yes | 7 | EXTRAKEY_ENABLE = yes |
6 | MOUSEKEY_ENABLE = yes | 8 | MOUSEKEY_ENABLE = yes |
7 | NKRO_ENABLE = yes | 9 | NKRO_ENABLE = yes |
8 | RGBLIGHT_ENABLE = no | ||
9 | SPACE_CADET_ENABLE = no | ||
10 | TAP_DANCE_ENABLE = yes | 10 | TAP_DANCE_ENABLE = yes |
11 | UNICODEMAP_ENABLE = no | 11 | UNICODEMAP_ENABLE = no |
12 | 12 | ||
13 | USER_NAME = konstantin | 13 | # Keyboard-specific features |
14 | BACKLIGHT_ENABLE = no | ||
15 | RGBLIGHT_ENABLE = no | ||
16 | VIA_ENABLE = yes | ||
17 | |||
18 | # Firmware size reduction | ||
19 | GRAVE_ESC_ENABLE = no | ||
20 | MAGIC_ENABLE = no | ||
21 | SPACE_CADET_ENABLE = no | ||
diff --git a/keyboards/evyd13/wasdat/keymaps/konstantin/config.h b/keyboards/evyd13/wasdat/keymaps/konstantin/config.h index 1d12c7db3..3c2583e2d 100644 --- a/keyboards/evyd13/wasdat/keymaps/konstantin/config.h +++ b/keyboards/evyd13/wasdat/keymaps/konstantin/config.h | |||
@@ -1,6 +1,4 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #define DYNAMIC_KEYMAP_LAYER_COUNT 3 | ||
4 | |||
5 | #define LAYER_FN | 3 | #define LAYER_FN |
6 | #define LAYER_NUMPAD | 4 | #define LAYER_NUMPAD |
diff --git a/keyboards/evyd13/wasdat/keymaps/konstantin/rules.mk b/keyboards/evyd13/wasdat/keymaps/konstantin/rules.mk index 2ae41e942..f73ad286a 100644 --- a/keyboards/evyd13/wasdat/keymaps/konstantin/rules.mk +++ b/keyboards/evyd13/wasdat/keymaps/konstantin/rules.mk | |||
@@ -1,5 +1,5 @@ | |||
1 | # Generic features | 1 | # Generic features |
2 | BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite | 2 | BOOTMAGIC_ENABLE = yes |
3 | COMMAND_ENABLE = yes | 3 | COMMAND_ENABLE = yes |
4 | CONSOLE_ENABLE = yes | 4 | CONSOLE_ENABLE = yes |
5 | EXTRAKEY_ENABLE = yes | 5 | EXTRAKEY_ENABLE = yes |
diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h b/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h index 37f4e42c7..4b511eb84 100644 --- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h | |||
@@ -1,5 +1,3 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #define DYNAMIC_KEYMAP_LAYER_COUNT 3 | ||
4 | |||
5 | #define LAYER_FN | 3 | #define LAYER_FN |
diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c index 304234a3f..43bd06da9 100644 --- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c | |||
@@ -1,70 +1,38 @@ | |||
1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
2 | #include "konstantin.h" | 2 | #include "konstantin.h" |
3 | 3 | ||
4 | enum keycodes_keymap { | ||
5 | RCTRL = RANGE_KEYMAP, | ||
6 | }; | ||
7 | |||
8 | enum layers_keymap { | 4 | enum layers_keymap { |
9 | L_RCTRL = LAYERS_KEYMAP, | 5 | L_RCTRL = LAYERS_KEYMAP, |
10 | }; | 6 | }; |
11 | 7 | ||
12 | void eeconfig_init_keymap(void) { | 8 | enum keycodes_keymap { |
13 | rgblight_sethsv(MODERN_DOLCH_RED); | 9 | RCTRL = RANGE_KEYMAP, |
14 | rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); | 10 | }; |
15 | } | ||
16 | |||
17 | bool indicator_light = false; | ||
18 | |||
19 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
20 | switch (keycode) { | ||
21 | case RGB_TOG ... RGB_SPD: | ||
22 | // Disable RGB controls when Fn/Caps indicator lights are on | ||
23 | if (indicator_light) { | ||
24 | return false; | ||
25 | } | ||
26 | // Shift+Toggle = reset RGB | ||
27 | if (record->event.pressed && keycode == RGB_TOG && get_mods() & MOD_MASK_SHIFT) { | ||
28 | eeconfig_init_keymap(); | ||
29 | return false; | ||
30 | } | ||
31 | break; | ||
32 | |||
33 | // Combined RCtrl and layer | ||
34 | case RCTRL: | ||
35 | if (record->event.pressed) { | ||
36 | register_code(KC_RCTRL); | ||
37 | layer_on(L_RCTRL); | ||
38 | } else { | ||
39 | unregister_code(KC_RCTRL); | ||
40 | layer_off(L_RCTRL); | ||
41 | } | ||
42 | break; | ||
43 | } | ||
44 | 11 | ||
45 | return true; | 12 | static inline void reset_light(void) { |
13 | rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); | ||
14 | rgblight_sethsv(MODERN_DOLCH_RED); | ||
46 | } | 15 | } |
47 | 16 | ||
48 | static inline void fn_light(void) { | 17 | static inline void fn_light(void) { |
49 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | 18 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); |
50 | rgblight_sethsv_noeeprom(modern_dolch_red.h, modern_dolch_red.s, rgblight_get_val()); | 19 | rgblight_sethsv_noeeprom(modern_dolch_red.h, modern_dolch_red.s, rgblight_get_val()); |
51 | indicator_light = true; | ||
52 | } | 20 | } |
53 | 21 | ||
54 | static inline void caps_light(void) { | 22 | static inline void caps_light(void) { |
55 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | 23 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); |
56 | rgblight_sethsv_noeeprom(modern_dolch_cyan.h, modern_dolch_cyan.s, rgblight_get_val()); | 24 | rgblight_sethsv_noeeprom(modern_dolch_cyan.h, modern_dolch_cyan.s, rgblight_get_val()); |
57 | indicator_light = true; | ||
58 | } | 25 | } |
59 | 26 | ||
60 | static inline void restore_light(void) { | 27 | static inline void restore_light(void) { |
61 | rgblight_config_t saved = { .raw = eeconfig_read_rgblight() }; | 28 | rgblight_config_t saved = { .raw = eeconfig_read_rgblight() }; |
62 | rgblight_sethsv_noeeprom(saved.hue, saved.sat, saved.val); | ||
63 | rgblight_mode_noeeprom(saved.mode); | 29 | rgblight_mode_noeeprom(saved.mode); |
64 | indicator_light = false; | 30 | rgblight_sethsv_noeeprom(saved.hue, saved.sat, saved.val); |
65 | } | 31 | } |
66 | 32 | ||
67 | static void check_light_layer(uint32_t state) { | 33 | static bool last_checked_layer; |
34 | |||
35 | static void check_light_layer(layer_state_t state) { | ||
68 | if (IS_LAYER_ON_STATE(state, L_FN)) { | 36 | if (IS_LAYER_ON_STATE(state, L_FN)) { |
69 | fn_light(); | 37 | fn_light(); |
70 | } else if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { | 38 | } else if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { |
@@ -72,22 +40,34 @@ static void check_light_layer(uint32_t state) { | |||
72 | } else { | 40 | } else { |
73 | restore_light(); | 41 | restore_light(); |
74 | } | 42 | } |
43 | last_checked_layer = true; | ||
75 | } | 44 | } |
76 | 45 | ||
77 | static void check_light_led(uint8_t usb_led) { | 46 | static void check_light_led(uint8_t leds) { |
78 | if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | 47 | if (IS_LED_ON(leds, USB_LED_CAPS_LOCK)) { |
79 | caps_light(); | 48 | caps_light(); |
80 | } else if (IS_LAYER_ON(L_FN)) { | 49 | } else if (IS_LAYER_ON(L_FN)) { |
81 | fn_light(); | 50 | fn_light(); |
82 | } else { | 51 | } else { |
83 | restore_light(); | 52 | restore_light(); |
84 | } | 53 | } |
54 | last_checked_layer = false; | ||
55 | } | ||
56 | |||
57 | static void inline check_light(void) { | ||
58 | last_checked_layer | ||
59 | ? check_light_layer(layer_state) | ||
60 | : check_light_led(host_keyboard_leds()); | ||
61 | } | ||
62 | |||
63 | void eeconfig_init_keymap(void) { | ||
64 | reset_light(); | ||
85 | } | 65 | } |
86 | 66 | ||
87 | static bool skip_led = false; | 67 | static bool skip_led = false; |
88 | 68 | ||
89 | uint32_t layer_state_set_keymap(uint32_t state) { | 69 | layer_state_t layer_state_set_keymap(layer_state_t state) { |
90 | static uint32_t prev_state = L_BASE; | 70 | static layer_state_t prev_state = L_BASE; |
91 | if (IS_LAYER_ON_STATE(state, L_FN) != IS_LAYER_ON_STATE(prev_state, L_FN)) { | 71 | if (IS_LAYER_ON_STATE(state, L_FN) != IS_LAYER_ON_STATE(prev_state, L_FN)) { |
92 | check_light_layer(state); // Fn state changed since last time | 72 | check_light_layer(state); // Fn state changed since last time |
93 | skip_led = IS_LAYER_ON_STATE(state, L_FN); | 73 | skip_led = IS_LAYER_ON_STATE(state, L_FN); |
@@ -104,6 +84,37 @@ void led_set_keymap(uint8_t usb_led) { | |||
104 | check_light_led(usb_led); | 84 | check_light_led(usb_led); |
105 | } | 85 | } |
106 | 86 | ||
87 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
88 | switch (keycode) { | ||
89 | case RGB_TOG ... RGB_SPD: | ||
90 | if (record->event.pressed) { | ||
91 | // Shift+Toggle = reset RGB | ||
92 | if (keycode == RGB_TOG && get_mods() & MOD_MASK_SHIFT) { | ||
93 | reset_light(); | ||
94 | return false; | ||
95 | } | ||
96 | restore_light(); | ||
97 | } else { | ||
98 | check_light(); | ||
99 | } | ||
100 | break; | ||
101 | |||
102 | // Combined RCtrl and layer | ||
103 | // Cannot use LM(L_RCTRL, MOD_RCTL) because it sends LCtrl instead of RCtrl | ||
104 | case RCTRL: | ||
105 | if (record->event.pressed) { | ||
106 | register_code(KC_RCTRL); | ||
107 | layer_on(L_RCTRL); | ||
108 | } else { | ||
109 | unregister_code(KC_RCTRL); | ||
110 | layer_off(L_RCTRL); | ||
111 | } | ||
112 | break; | ||
113 | } | ||
114 | |||
115 | return true; | ||
116 | } | ||
117 | |||
107 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 118 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
108 | /* Base layer | 119 | /* Base layer |
109 | * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ | 120 | * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ |
@@ -157,7 +168,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
157 | * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ | 168 | * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ |
158 | * │ │RTg│RV-│RV+│RMd│ │ │ │ │ │ │ │ │ | 169 | * │ │RTg│RV-│RV+│RMd│ │ │ │ │ │ │ │ │ |
159 | * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ | 170 | * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ |
160 | * │DPR│DstNA│ │ │ │ | 171 | * │DPR│DstNA│ │RGui │ │ |
161 | * └───┴─────┴───────────────────────────┴─────┴───┘ | 172 | * └───┴─────┴───────────────────────────┴─────┴───┘ |
162 | */ | 173 | */ |
163 | [L_RCTRL] = LAYOUT( | 174 | [L_RCTRL] = LAYOUT( |
@@ -165,6 +176,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
165 | _______, TOP, MV_UP, BOTTOM, TAB_PRV, _______, _______, _______, _______, _______, _______, _______, _______, DEL_NXT, | 176 | _______, TOP, MV_UP, BOTTOM, TAB_PRV, _______, _______, _______, _______, _______, _______, _______, _______, DEL_NXT, |
166 | _______, MV_LEFT, MV_DOWN, MV_RGHT, TAB_NXT, _______, _______, _______, _______, _______, _______, _______, _______, | 177 | _______, MV_LEFT, MV_DOWN, MV_RGHT, TAB_NXT, _______, _______, _______, _______, _______, _______, _______, _______, |
167 | _______, RGB_TOG, RGB_VAD, RGB_VAI, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, | 178 | _______, RGB_TOG, RGB_VAD, RGB_VAI, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, |
168 | XXXXXXX, DST_P_R, DST_N_A, _______, _______, _______, XXXXXXX | 179 | XXXXXXX, DST_P_R, DST_N_A, _______, KC_RGUI, _______, XXXXXXX |
169 | ), | 180 | ), |
170 | }; | 181 | }; |
diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk index 0f7f72f34..cff02d7c5 100644 --- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk | |||
@@ -1,7 +1,7 @@ | |||
1 | # Generic features | 1 | # Generic features |
2 | BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite | 2 | BOOTMAGIC_ENABLE = yes |
3 | COMMAND_ENABLE = yes | 3 | COMMAND_ENABLE = yes |
4 | CONSOLE_ENABLE = no | 4 | CONSOLE_ENABLE = yes |
5 | EXTRAKEY_ENABLE = yes | 5 | EXTRAKEY_ENABLE = yes |
6 | MOUSEKEY_ENABLE = yes | 6 | MOUSEKEY_ENABLE = yes |
7 | NKRO_ENABLE = yes | 7 | NKRO_ENABLE = yes |
diff --git a/keyboards/melody96/keymaps/konstantin/rules.mk b/keyboards/melody96/keymaps/konstantin/rules.mk index e02c6c7b1..816ece7b2 100644 --- a/keyboards/melody96/keymaps/konstantin/rules.mk +++ b/keyboards/melody96/keymaps/konstantin/rules.mk | |||
@@ -1,5 +1,5 @@ | |||
1 | # Generic features | 1 | # Generic features |
2 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | 2 | BOOTMAGIC_ENABLE = yes |
3 | COMMAND_ENABLE = yes | 3 | COMMAND_ENABLE = yes |
4 | CONSOLE_ENABLE = yes | 4 | CONSOLE_ENABLE = yes |
5 | EXTRAKEY_ENABLE = yes | 5 | EXTRAKEY_ENABLE = yes |
@@ -11,6 +11,7 @@ UNICODEMAP_ENABLE = yes | |||
11 | # Keyboard-specific features | 11 | # Keyboard-specific features |
12 | BACKLIGHT_ENABLE = no | 12 | BACKLIGHT_ENABLE = no |
13 | RGBLIGHT_ENABLE = yes | 13 | RGBLIGHT_ENABLE = yes |
14 | VIA_ENABLE = yes | ||
14 | 15 | ||
15 | # Firmware size reduction | 16 | # Firmware size reduction |
16 | GRAVE_ESC_ENABLE = no | 17 | GRAVE_ESC_ENABLE = no |
diff --git a/keyboards/whitefox/keymaps/konstantin/rules.mk b/keyboards/whitefox/keymaps/konstantin/rules.mk index bb327cf26..afdeb979e 100644 --- a/keyboards/whitefox/keymaps/konstantin/rules.mk +++ b/keyboards/whitefox/keymaps/konstantin/rules.mk | |||
@@ -1,5 +1,5 @@ | |||
1 | # Generic features | 1 | # Generic features |
2 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | 2 | BOOTMAGIC_ENABLE = yes |
3 | COMMAND_ENABLE = yes | 3 | COMMAND_ENABLE = yes |
4 | CONSOLE_ENABLE = yes | 4 | CONSOLE_ENABLE = yes |
5 | EXTRAKEY_ENABLE = yes | 5 | EXTRAKEY_ENABLE = yes |
diff --git a/users/konstantin/config.h b/users/konstantin/config.h index 2629cdd57..d42945236 100644 --- a/users/konstantin/config.h +++ b/users/konstantin/config.h | |||
@@ -1,3 +1,19 @@ | |||
1 | /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
1 | #pragma once | 17 | #pragma once |
2 | 18 | ||
3 | // Keyboard reports | 19 | // Keyboard reports |
@@ -24,7 +40,7 @@ | |||
24 | // Tapping | 40 | // Tapping |
25 | #define PERMISSIVE_HOLD | 41 | #define PERMISSIVE_HOLD |
26 | #define TAPPING_TERM 200 | 42 | #define TAPPING_TERM 200 |
27 | #define TAPPING_TOGGLE 3 | 43 | #define TAPPING_TOGGLE 2 |
28 | 44 | ||
29 | // Unicode | 45 | // Unicode |
30 | #define UNICODE_CYCLE_PERSIST false | 46 | #define UNICODE_CYCLE_PERSIST false |
diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c index 3fdf5a4ca..5d80877f0 100644 --- a/users/konstantin/konstantin.c +++ b/users/konstantin/konstantin.c | |||
@@ -1,3 +1,19 @@ | |||
1 | /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
1 | #include "konstantin.h" | 17 | #include "konstantin.h" |
2 | 18 | ||
3 | __attribute__((weak)) | 19 | __attribute__((weak)) |
@@ -22,6 +38,41 @@ void keyboard_post_init_user(void) { | |||
22 | } | 38 | } |
23 | 39 | ||
24 | __attribute__((weak)) | 40 | __attribute__((weak)) |
41 | layer_state_t layer_state_set_keymap(layer_state_t state) { | ||
42 | return state; | ||
43 | } | ||
44 | |||
45 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
46 | state = layer_state_set_keymap(state); | ||
47 | |||
48 | #ifdef LAYER_NUMPAD | ||
49 | bool numpad = IS_LAYER_ON_STATE(state, L_NUMPAD); | ||
50 | bool num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); | ||
51 | if (numpad != num_lock) { | ||
52 | tap_code(KC_NLCK); // Toggle Num Lock to match Numpad layer state | ||
53 | } | ||
54 | #endif | ||
55 | |||
56 | return state; | ||
57 | } | ||
58 | |||
59 | __attribute__((weak)) | ||
60 | void led_set_keymap(uint8_t usb_led) {} | ||
61 | |||
62 | void led_set_user(uint8_t usb_led) { | ||
63 | led_set_keymap(usb_led); | ||
64 | } | ||
65 | |||
66 | __attribute__((weak)) | ||
67 | bool led_update_keymap(led_t led_state) { | ||
68 | return true; | ||
69 | } | ||
70 | |||
71 | bool led_update_user(led_t led_state) { | ||
72 | return led_update_keymap(led_state); | ||
73 | } | ||
74 | |||
75 | __attribute__((weak)) | ||
25 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 76 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
26 | return true; | 77 | return true; |
27 | } | 78 | } |
@@ -91,38 +142,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
91 | 142 | ||
92 | return true; | 143 | return true; |
93 | } | 144 | } |
94 | |||
95 | __attribute__((weak)) | ||
96 | uint32_t layer_state_set_keymap(uint32_t state) { | ||
97 | return state; | ||
98 | } | ||
99 | |||
100 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
101 | state = layer_state_set_keymap(state); | ||
102 | |||
103 | #ifdef LAYER_NUMPAD | ||
104 | bool numpad = IS_LAYER_ON_STATE(state, L_NUMPAD); | ||
105 | bool num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); | ||
106 | if (numpad != num_lock) { | ||
107 | tap_code(KC_NLCK); // Toggle Num Lock to match Numpad layer state | ||
108 | } | ||
109 | #endif | ||
110 | |||
111 | return state; | ||
112 | } | ||
113 | |||
114 | __attribute__((weak)) | ||
115 | void led_set_keymap(uint8_t usb_led) {} | ||
116 | |||
117 | void led_set_user(uint8_t usb_led) { | ||
118 | led_set_keymap(usb_led); | ||
119 | } | ||
120 | |||
121 | __attribute__((weak)) | ||
122 | bool led_update_keymap(led_t led_state) { | ||
123 | return true; | ||
124 | } | ||
125 | |||
126 | bool led_update_user(led_t led_state) { | ||
127 | return led_update_keymap(led_state); | ||
128 | } | ||
diff --git a/users/konstantin/konstantin.h b/users/konstantin/konstantin.h index 249b3fe15..7da1dbfd2 100644 --- a/users/konstantin/konstantin.h +++ b/users/konstantin/konstantin.h | |||
@@ -1,3 +1,19 @@ | |||
1 | /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
1 | #pragma once | 17 | #pragma once |
2 | 18 | ||
3 | #include "quantum.h" | 19 | #include "quantum.h" |
@@ -56,14 +72,6 @@ | |||
56 | set_mods(mods); \ | 72 | set_mods(mods); \ |
57 | } | 73 | } |
58 | 74 | ||
59 | enum keycodes_user { | ||
60 | CLEAR = SAFE_RANGE, | ||
61 | DST_P_R, | ||
62 | DST_N_A, | ||
63 | |||
64 | RANGE_KEYMAP, | ||
65 | }; | ||
66 | |||
67 | enum layers_user { | 75 | enum layers_user { |
68 | L_BASE, | 76 | L_BASE, |
69 | #ifdef LAYER_FN | 77 | #ifdef LAYER_FN |
@@ -76,11 +84,21 @@ enum layers_user { | |||
76 | LAYERS_KEYMAP, | 84 | LAYERS_KEYMAP, |
77 | }; | 85 | }; |
78 | 86 | ||
87 | enum keycodes_user { | ||
88 | CLEAR = SAFE_RANGE, | ||
89 | DST_P_R, | ||
90 | DST_N_A, | ||
91 | |||
92 | RANGE_KEYMAP, | ||
93 | }; | ||
94 | |||
79 | void keyboard_pre_init_keymap(void); | 95 | void keyboard_pre_init_keymap(void); |
80 | void eeconfig_init_keymap(void); | 96 | void eeconfig_init_keymap(void); |
81 | void keyboard_post_init_keymap(void); | 97 | void keyboard_post_init_keymap(void); |
82 | 98 | ||
83 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record); | 99 | layer_state_t layer_state_set_keymap(layer_state_t state); |
84 | uint32_t layer_state_set_keymap(uint32_t state); | 100 | |
85 | void led_set_keymap(uint8_t usb_led); | 101 | void led_set_keymap(uint8_t usb_led); |
86 | bool led_update_keymap(led_t led_state); | 102 | bool led_update_keymap(led_t led_state); |
103 | |||
104 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record); | ||
diff --git a/users/konstantin/post_config.h b/users/konstantin/post_config.h new file mode 100644 index 000000000..3199b2124 --- /dev/null +++ b/users/konstantin/post_config.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* Copyright 2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #pragma once | ||
18 | |||
19 | // VIA | ||
20 | #ifndef DYNAMIC_KEYMAP_LAYER_COUNT | ||
21 | #define DYNAMIC_KEYMAP_LAYER_COUNT 3 | ||
22 | #endif | ||
diff --git a/users/konstantin/rgb.c b/users/konstantin/rgb.c index fffa250f2..2eeef829b 100644 --- a/users/konstantin/rgb.c +++ b/users/konstantin/rgb.c | |||
@@ -1,3 +1,19 @@ | |||
1 | /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
1 | #include "rgb.h" | 17 | #include "rgb.h" |
2 | 18 | ||
3 | #ifdef RGBLIGHT_EFFECT_BREATHING | 19 | #ifdef RGBLIGHT_EFFECT_BREATHING |
diff --git a/users/konstantin/rgb.h b/users/konstantin/rgb.h index e09c5bd77..3425dcb06 100644 --- a/users/konstantin/rgb.h +++ b/users/konstantin/rgb.h | |||
@@ -1,3 +1,19 @@ | |||
1 | /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
1 | #pragma once | 17 | #pragma once |
2 | 18 | ||
3 | #include "quantum.h" | 19 | #include "quantum.h" |
diff --git a/users/konstantin/tap_dance.c b/users/konstantin/tap_dance.c index 4ec8caa63..57a29d98b 100644 --- a/users/konstantin/tap_dance.c +++ b/users/konstantin/tap_dance.c | |||
@@ -1,3 +1,19 @@ | |||
1 | /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
1 | #include "tap_dance.h" | 17 | #include "tap_dance.h" |
2 | #include "konstantin.h" | 18 | #include "konstantin.h" |
3 | 19 | ||
diff --git a/users/konstantin/tap_dance.h b/users/konstantin/tap_dance.h index 56889a19e..047662a8e 100644 --- a/users/konstantin/tap_dance.h +++ b/users/konstantin/tap_dance.h | |||
@@ -1,3 +1,19 @@ | |||
1 | /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
1 | #pragma once | 17 | #pragma once |
2 | 18 | ||
3 | #include "quantum.h" | 19 | #include "quantum.h" |
diff --git a/users/konstantin/unicode.c b/users/konstantin/unicode.c index 8ef5aaa1e..4eae716af 100644 --- a/users/konstantin/unicode.c +++ b/users/konstantin/unicode.c | |||
@@ -1,3 +1,19 @@ | |||
1 | /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
1 | #include "unicode.h" | 17 | #include "unicode.h" |
2 | 18 | ||
3 | #ifdef UNICODEMAP_ENABLE | 19 | #ifdef UNICODEMAP_ENABLE |
diff --git a/users/konstantin/unicode.h b/users/konstantin/unicode.h index b2616d120..1a1eb6089 100644 --- a/users/konstantin/unicode.h +++ b/users/konstantin/unicode.h | |||
@@ -1,3 +1,19 @@ | |||
1 | /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com> | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
1 | #pragma once | 17 | #pragma once |
2 | 18 | ||
3 | #include "quantum.h" | 19 | #include "quantum.h" |