Skip to content

Commit

Permalink
Fix caps word + autoshift
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Jul 12, 2022
1 parent 60c1aa3 commit 42519ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion quantum/process_keycode/process_auto_shift.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ bool get_autoshift_shift_state(uint16_t keycode) {
/** \brief Restores the shift key if it was cancelled by Auto Shift */
static void autoshift_flush_shift(void) {
autoshift_flags.holding_shift = false;
del_weak_mods(MOD_BIT(KC_LSFT));
# ifdef CAPS_WORD_ENABLE
if (!is_caps_word_on())
# endif
{
del_weak_mods(MOD_BIT(KC_LSFT));
}
if (autoshift_flags.cancelling_lshift) {
autoshift_flags.cancelling_lshift = false;
add_mods(MOD_BIT(KC_LSFT));
Expand Down
4 changes: 4 additions & 0 deletions quantum/process_keycode/process_caps_word.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) {
#endif // SWAP_HANDS_ENABLE
}

#ifdef AUTO_SHIFT_ENABLE
del_weak_mods(get_autoshift_state() ? ~MOD_BIT(KC_LSFT) : 0xff);
#else
clear_weak_mods();
#endif
if (caps_word_press_user(keycode)) {
send_keyboard_report();
return true;
Expand Down

0 comments on commit 42519ed

Please sign in to comment.