[Keymap] Update personal userspace and keymaps (#8747)

* Update mousekey parameters in userspace

* Disable GRAVE_ESC in boards where it isn't used

* Tweak MODERN_DOLCH_RED and reset RGB on Shift+Toggle in KBD6X

* Disable RGB controls when Fn/Caps indicator lights are on

* Use LTO_ENABLE instead of setting -flto directly

* Add led_update_keymap, use SS_LCTL instead of SS_LCTRL

* Change TAPPING_TOGGLE from 2 to 3
This commit is contained in:
Konstantin Đorđević 2020-04-09 18:54:19 +02:00 committed by GitHub
parent 07c75feba3
commit 439afc883a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 43 additions and 8 deletions

View File

@ -3,6 +3,7 @@ BOOTMAGIC_ENABLE = no
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
CONSOLE_ENABLE = yes CONSOLE_ENABLE = yes
EXTRAKEY_ENABLE = yes EXTRAKEY_ENABLE = yes
GRAVE_ESC_ENABLE = no
MOUSEKEY_ENABLE = yes MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes NKRO_ENABLE = yes
SPACE_CADET_ENABLE = no SPACE_CADET_ENABLE = no

View File

@ -14,8 +14,23 @@ void eeconfig_init_keymap(void) {
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL);
} }
bool indicator_light = false;
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case RGB_TOG ... RGB_SPD:
// Disable RGB controls when Fn/Caps indicator lights are on
if (indicator_light) {
return false;
}
// Shift+Toggle = reset RGB
if (record->event.pressed && keycode == RGB_TOG && get_mods() & MOD_MASK_SHIFT) {
eeconfig_init_keymap();
return false;
}
break;
// Combined RCtrl and layer
case RCTRL: case RCTRL:
if (record->event.pressed) { if (record->event.pressed) {
register_code(KC_RCTRL); register_code(KC_RCTRL);
@ -33,17 +48,20 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
static inline void fn_light(void) { static inline void fn_light(void) {
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
rgblight_sethsv_noeeprom(modern_dolch_red.h, modern_dolch_red.s, rgblight_get_val()); rgblight_sethsv_noeeprom(modern_dolch_red.h, modern_dolch_red.s, rgblight_get_val());
indicator_light = true;
} }
static inline void caps_light(void) { static inline void caps_light(void) {
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
rgblight_sethsv_noeeprom(modern_dolch_cyan.h, modern_dolch_cyan.s, rgblight_get_val()); rgblight_sethsv_noeeprom(modern_dolch_cyan.h, modern_dolch_cyan.s, rgblight_get_val());
indicator_light = true;
} }
static inline void restore_light(void) { static inline void restore_light(void) {
rgblight_config_t saved = { .raw = eeconfig_read_rgblight() }; rgblight_config_t saved = { .raw = eeconfig_read_rgblight() };
rgblight_sethsv_noeeprom(saved.hue, saved.sat, saved.val); rgblight_sethsv_noeeprom(saved.hue, saved.sat, saved.val);
rgblight_mode_noeeprom(saved.mode); rgblight_mode_noeeprom(saved.mode);
indicator_light = false;
} }
static void check_light_layer(uint32_t state) { static void check_light_layer(uint32_t state) {

View File

@ -3,6 +3,7 @@ BOOTMAGIC_ENABLE = no
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
CONSOLE_ENABLE = no CONSOLE_ENABLE = no
EXTRAKEY_ENABLE = yes EXTRAKEY_ENABLE = yes
GRAVE_ESC_ENABLE = no
MOUSEKEY_ENABLE = yes MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes NKRO_ENABLE = yes
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes

View File

@ -3,6 +3,7 @@ BOOTMAGIC_ENABLE = no
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
CONSOLE_ENABLE = yes CONSOLE_ENABLE = yes
EXTRAKEY_ENABLE = yes EXTRAKEY_ENABLE = yes
GRAVE_ESC_ENABLE = no
MOUSEKEY_ENABLE = yes MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes NKRO_ENABLE = yes
SPACE_CADET_ENABLE = no SPACE_CADET_ENABLE = no

View File

@ -3,6 +3,7 @@ BOOTMAGIC_ENABLE = no
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
CONSOLE_ENABLE = no CONSOLE_ENABLE = no
EXTRAKEY_ENABLE = yes EXTRAKEY_ENABLE = yes
GRAVE_ESC_ENABLE = no
MOUSEKEY_ENABLE = yes MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes NKRO_ENABLE = yes
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes

View File

@ -3,6 +3,7 @@ BOOTMAGIC_ENABLE = no
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
CONSOLE_ENABLE = yes CONSOLE_ENABLE = yes
EXTRAKEY_ENABLE = yes EXTRAKEY_ENABLE = yes
GRAVE_ESC_ENABLE = no
MOUSEKEY_ENABLE = yes MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes NKRO_ENABLE = yes
SPACE_CADET_ENABLE = no SPACE_CADET_ENABLE = no

View File

@ -2,11 +2,13 @@
#define FORCE_NKRO #define FORCE_NKRO
#define MOUSEKEY_DELAY 50 #define MOUSEKEY_DELAY 0
#define MOUSEKEY_INTERVAL 15 #define MOUSEKEY_INTERVAL 10
#define MOUSEKEY_MAX_SPEED 4 #define MOUSEKEY_MAX_SPEED 4
#define MOUSEKEY_TIME_TO_MAX 50 #define MOUSEKEY_TIME_TO_MAX 100
#define MOUSEKEY_WHEEL_MAX_SPEED 1 #define MOUSEKEY_WHEEL_DELAY 0
#define MOUSEKEY_WHEEL_INTERVAL 50
#define MOUSEKEY_WHEEL_MAX_SPEED 4
#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 #define MOUSEKEY_WHEEL_TIME_TO_MAX 50
#define NO_ACTION_FUNCTION #define NO_ACTION_FUNCTION
@ -21,7 +23,7 @@
#define PERMISSIVE_HOLD #define PERMISSIVE_HOLD
#define TAPPING_TERM 200 #define TAPPING_TERM 200
#define TAPPING_TOGGLE 2 #define TAPPING_TOGGLE 3
#define UNICODE_CYCLE_PERSIST false #define UNICODE_CYCLE_PERSIST false
#define UNICODE_SELECTED_MODES UC_WINC, UC_WIN, UC_LNX #define UNICODE_SELECTED_MODES UC_WINC, UC_WIN, UC_LNX

View File

@ -69,7 +69,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case CLEAR: case CLEAR:
if (record->event.pressed) { if (record->event.pressed) {
CLEAN_MODS( CLEAN_MODS(
SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); SEND_STRING(SS_LCTL("a") SS_TAP(X_DELETE));
) )
} }
break; break;
@ -117,3 +117,12 @@ void led_set_keymap(uint8_t usb_led) {}
void led_set_user(uint8_t usb_led) { void led_set_user(uint8_t usb_led) {
led_set_keymap(usb_led); led_set_keymap(usb_led);
} }
__attribute__((weak))
bool led_update_keymap(led_t led_state) {
return true;
}
bool led_update_user(led_t led_state) {
return led_update_keymap(led_state);
}

View File

@ -86,3 +86,4 @@ void keyboard_post_init_keymap(void);
bool process_record_keymap(uint16_t keycode, keyrecord_t *record); bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
uint32_t layer_state_set_keymap(uint32_t state); uint32_t layer_state_set_keymap(uint32_t state);
void led_set_keymap(uint8_t usb_led); void led_set_keymap(uint8_t usb_led);
bool led_update_keymap(led_t led_state);

View File

@ -5,7 +5,7 @@
#define GODSPEED_BLUE 198, 68, 255 #define GODSPEED_BLUE 198, 68, 255
#define GODSPEED_YELLOW 27, 153, 255 #define GODSPEED_YELLOW 27, 153, 255
#define MODERN_DOLCH_CYAN 110, 255, 108 #define MODERN_DOLCH_CYAN 110, 255, 108
#define MODERN_DOLCH_RED 251, 255, 108 #define MODERN_DOLCH_RED 253, 255, 108
extern const HSV godspeed_blue; extern const HSV godspeed_blue;
extern const HSV godspeed_yellow; extern const HSV godspeed_yellow;

View File

@ -13,4 +13,4 @@ ifneq (,$(filter yes,$(UNICODE_ENABLE) $(UNICODEMAP_ENABLE)))
SRC += unicode.c SRC += unicode.c
endif endif
EXTRAFLAGS += -flto LTO_ENABLE = yes