aboutsummaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
authorKonstantin Đorđević <vomindoraan@gmail.com>2021-09-19 20:47:40 +0200
committerGitHub <noreply@github.com>2021-09-19 11:47:40 -0700
commit4348e2ffc11533a384d0eea452c954e57fe7e44c (patch)
tree4e90b052f194f5b377c287bd71a62af973a44ef6 /keyboards
parente83fb69ae8a579648a6a73e00399d3d144e51f88 (diff)
downloadqmk_firmware-4348e2ffc11533a384d0eea452c954e57fe7e44c.tar.gz
qmk_firmware-4348e2ffc11533a384d0eea452c954e57fe7e44c.zip
[Keymap] Updates to existing keymaps and userspace (#14503)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards')
-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
10 files changed, 79 insertions, 65 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