Fix caps word + autoshift (#351)

This commit is contained in:
Drashna Jaelre
2022-07-12 16:35:17 -07:00
committed by GitHub
parent 60c1aa3677
commit 085f0898e0
2 changed files with 10 additions and 1 deletions

View File

@@ -123,7 +123,12 @@ bool get_autoshift_shift_state(uint16_t keycode) {
/** \brief Restores the shift key if it was cancelled by Auto Shift */ /** \brief Restores the shift key if it was cancelled by Auto Shift */
static void autoshift_flush_shift(void) { static void autoshift_flush_shift(void) {
autoshift_flags.holding_shift = false; autoshift_flags.holding_shift = false;
# ifdef CAPS_WORD_ENABLE
if (!is_caps_word_on())
# endif
{
del_weak_mods(MOD_BIT(KC_LSFT)); del_weak_mods(MOD_BIT(KC_LSFT));
}
if (autoshift_flags.cancelling_lshift) { if (autoshift_flags.cancelling_lshift) {
autoshift_flags.cancelling_lshift = false; autoshift_flags.cancelling_lshift = false;
add_mods(MOD_BIT(KC_LSFT)); add_mods(MOD_BIT(KC_LSFT));

View File

@@ -131,7 +131,11 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) {
#endif // SWAP_HANDS_ENABLE #endif // SWAP_HANDS_ENABLE
} }
#ifdef AUTO_SHIFT_ENABLE
del_weak_mods(get_autoshift_state() ? ~MOD_BIT(KC_LSFT) : 0xff);
#else
clear_weak_mods(); clear_weak_mods();
#endif
if (caps_word_press_user(keycode)) { if (caps_word_press_user(keycode)) {
send_keyboard_report(); send_keyboard_report();
return true; return true;