diff options
| author | Konstantin Đorđević <vomindoraan@gmail.com> | 2021-09-19 20:47:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-19 11:47:40 -0700 |
| commit | 4348e2ffc11533a384d0eea452c954e57fe7e44c (patch) | |
| tree | 4e90b052f194f5b377c287bd71a62af973a44ef6 /keyboards | |
| parent | e83fb69ae8a579648a6a73e00399d3d144e51f88 (diff) | |
| download | qmk_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')
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 |
| 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 |
