summaryrefslogtreecommitdiff
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-07-12 16:35:17 -0700
committerGitHub <noreply@github.com>2022-07-13 08:35:17 +0900
commit085f0898e038903a677b4270ec0ba6259f66404f (patch)
tree921735c26e072874c626992a16d74c71f79a1ad1 /quantum/process_keycode
parent60c1aa3677e3c4ceb2595cbf678b0525a026ce7b (diff)
Fix caps word + autoshift (#351)
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r--quantum/process_keycode/process_auto_shift.c7
-rw-r--r--quantum/process_keycode/process_caps_word.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c
index e6a7c01f2a..2bf0146a77 100644
--- a/quantum/process_keycode/process_auto_shift.c
+++ b/quantum/process_keycode/process_auto_shift.c
@@ -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));
diff --git a/quantum/process_keycode/process_caps_word.c b/quantum/process_keycode/process_caps_word.c
index ffd509a914..b1415c33b5 100644
--- a/quantum/process_keycode/process_caps_word.c
+++ b/quantum/process_keycode/process_caps_word.c
@@ -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;