aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/doro67/multi/keymaps/konstantin/config.h2
-rw-r--r--keyboards/doro67/multi/keymaps/konstantin/rules.mk2
-rw-r--r--keyboards/dz60/keymaps/konstantin_b/rules.mk18
-rw-r--r--keyboards/evyd13/wasdat/keymaps/konstantin/config.h2
-rw-r--r--keyboards/evyd13/wasdat/keymaps/konstantin/rules.mk2
-rw-r--r--keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h2
-rw-r--r--keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c107
-rw-r--r--keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk4
-rw-r--r--keyboards/melody96/keymaps/konstantin/rules.mk3
-rw-r--r--keyboards/whitefox/keymaps/konstantin/rules.mk2
-rw-r--r--users/konstantin/config.h18
-rw-r--r--users/konstantin/konstantin.c86
-rw-r--r--users/konstantin/konstantin.h42
-rw-r--r--users/konstantin/post_config.h22
-rw-r--r--users/konstantin/rgb.c16
-rw-r--r--users/konstantin/rgb.h16
-rw-r--r--users/konstantin/tap_dance.c16
-rw-r--r--users/konstantin/tap_dance.h16
-rw-r--r--users/konstantin/unicode.c16
-rw-r--r--users/konstantin/unicode.h16
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
2BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite 2BOOTMAGIC_ENABLE = yes
3COMMAND_ENABLE = yes 3COMMAND_ENABLE = yes
4CONSOLE_ENABLE = yes 4CONSOLE_ENABLE = yes
5EXTRAKEY_ENABLE = yes 5EXTRAKEY_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 @@
1BACKLIGHT_ENABLE = no 1USER_NAME := konstantin
2BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite 2
3# Generic features
4BOOTMAGIC_ENABLE = yes
3COMMAND_ENABLE = yes 5COMMAND_ENABLE = yes
4CONSOLE_ENABLE = yes 6CONSOLE_ENABLE = yes
5EXTRAKEY_ENABLE = yes 7EXTRAKEY_ENABLE = yes
6MOUSEKEY_ENABLE = yes 8MOUSEKEY_ENABLE = yes
7NKRO_ENABLE = yes 9NKRO_ENABLE = yes
8RGBLIGHT_ENABLE = no
9SPACE_CADET_ENABLE = no
10TAP_DANCE_ENABLE = yes 10TAP_DANCE_ENABLE = yes
11UNICODEMAP_ENABLE = no 11UNICODEMAP_ENABLE = no
12 12
13USER_NAME = konstantin 13# Keyboard-specific features
14BACKLIGHT_ENABLE = no
15RGBLIGHT_ENABLE = no
16VIA_ENABLE = yes
17
18# Firmware size reduction
19GRAVE_ESC_ENABLE = no
20MAGIC_ENABLE = no
21SPACE_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
2BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite 2BOOTMAGIC_ENABLE = yes
3COMMAND_ENABLE = yes 3COMMAND_ENABLE = yes
4CONSOLE_ENABLE = yes 4CONSOLE_ENABLE = yes
5EXTRAKEY_ENABLE = yes 5EXTRAKEY_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
4enum keycodes_keymap {
5 RCTRL = RANGE_KEYMAP,
6};
7
8enum layers_keymap { 4enum layers_keymap {
9 L_RCTRL = LAYERS_KEYMAP, 5 L_RCTRL = LAYERS_KEYMAP,
10}; 6};
11 7
12void eeconfig_init_keymap(void) { 8enum keycodes_keymap {
13 rgblight_sethsv(MODERN_DOLCH_RED); 9 RCTRL = RANGE_KEYMAP,
14 rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); 10};
15}
16
17bool indicator_light = false;
18
19bool 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; 12static inline void reset_light(void) {
13 rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL);
14 rgblight_sethsv(MODERN_DOLCH_RED);
46} 15}
47 16
48static inline void fn_light(void) { 17static 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
54static inline void caps_light(void) { 22static 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
60static inline void restore_light(void) { 27static 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
67static void check_light_layer(uint32_t state) { 33static bool last_checked_layer;
34
35static 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
77static void check_light_led(uint8_t usb_led) { 46static 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
57static void inline check_light(void) {
58 last_checked_layer
59 ? check_light_layer(layer_state)
60 : check_light_led(host_keyboard_leds());
61}
62
63void eeconfig_init_keymap(void) {
64 reset_light();
85} 65}
86 66
87static bool skip_led = false; 67static bool skip_led = false;
88 68
89uint32_t layer_state_set_keymap(uint32_t state) { 69layer_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
87bool 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
107const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 118const 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
2BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite 2BOOTMAGIC_ENABLE = yes
3COMMAND_ENABLE = yes 3COMMAND_ENABLE = yes
4CONSOLE_ENABLE = no 4CONSOLE_ENABLE = yes
5EXTRAKEY_ENABLE = yes 5EXTRAKEY_ENABLE = yes
6MOUSEKEY_ENABLE = yes 6MOUSEKEY_ENABLE = yes
7NKRO_ENABLE = yes 7NKRO_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
2BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite 2BOOTMAGIC_ENABLE = yes
3COMMAND_ENABLE = yes 3COMMAND_ENABLE = yes
4CONSOLE_ENABLE = yes 4CONSOLE_ENABLE = yes
5EXTRAKEY_ENABLE = yes 5EXTRAKEY_ENABLE = yes
@@ -11,6 +11,7 @@ UNICODEMAP_ENABLE = yes
11# Keyboard-specific features 11# Keyboard-specific features
12BACKLIGHT_ENABLE = no 12BACKLIGHT_ENABLE = no
13RGBLIGHT_ENABLE = yes 13RGBLIGHT_ENABLE = yes
14VIA_ENABLE = yes
14 15
15# Firmware size reduction 16# Firmware size reduction
16GRAVE_ESC_ENABLE = no 17GRAVE_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
2BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite 2BOOTMAGIC_ENABLE = yes
3COMMAND_ENABLE = yes 3COMMAND_ENABLE = yes
4CONSOLE_ENABLE = yes 4CONSOLE_ENABLE = yes
5EXTRAKEY_ENABLE = yes 5EXTRAKEY_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))
41layer_state_t layer_state_set_keymap(layer_state_t state) {
42 return state;
43}
44
45layer_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))
60void led_set_keymap(uint8_t usb_led) {}
61
62void led_set_user(uint8_t usb_led) {
63 led_set_keymap(usb_led);
64}
65
66__attribute__((weak))
67bool led_update_keymap(led_t led_state) {
68 return true;
69}
70
71bool led_update_user(led_t led_state) {
72 return led_update_keymap(led_state);
73}
74
75__attribute__((weak))
25bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { 76bool 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))
96uint32_t layer_state_set_keymap(uint32_t state) {
97 return state;
98}
99
100layer_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))
115void led_set_keymap(uint8_t usb_led) {}
116
117void led_set_user(uint8_t usb_led) {
118 led_set_keymap(usb_led);
119}
120
121__attribute__((weak))
122bool led_update_keymap(led_t led_state) {
123 return true;
124}
125
126bool 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
59enum keycodes_user {
60 CLEAR = SAFE_RANGE,
61 DST_P_R,
62 DST_N_A,
63
64 RANGE_KEYMAP,
65};
66
67enum layers_user { 75enum 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
87enum keycodes_user {
88 CLEAR = SAFE_RANGE,
89 DST_P_R,
90 DST_N_A,
91
92 RANGE_KEYMAP,
93};
94
79void keyboard_pre_init_keymap(void); 95void keyboard_pre_init_keymap(void);
80void eeconfig_init_keymap(void); 96void eeconfig_init_keymap(void);
81void keyboard_post_init_keymap(void); 97void keyboard_post_init_keymap(void);
82 98
83bool process_record_keymap(uint16_t keycode, keyrecord_t *record); 99layer_state_t layer_state_set_keymap(layer_state_t state);
84uint32_t layer_state_set_keymap(uint32_t state); 100
85void led_set_keymap(uint8_t usb_led); 101void led_set_keymap(uint8_t usb_led);
86bool led_update_keymap(led_t led_state); 102bool led_update_keymap(led_t led_state);
103
104bool 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"