From a13ffeb2be170071196a8c12747ef85e3c7ee64f Mon Sep 17 00:00:00 2001 From: QyuriLa Date: Mon, 30 May 2022 01:02:35 +0900 Subject: [PATCH 1/2] Fix Caps Word to work properly with Auto Shift --- quantum/quantum.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index ac3e2d90b4d9..293e815358ec 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -298,6 +298,9 @@ bool process_record_quantum(keyrecord_t *record) { #ifdef PRINTING_ENABLE process_printer(keycode, record) && #endif +#ifdef CAPS_WORD_ENABLE + process_caps_word(keycode, record) && +#endif #ifdef AUTO_SHIFT_ENABLE process_auto_shift(keycode, record) && #endif @@ -307,9 +310,6 @@ bool process_record_quantum(keyrecord_t *record) { #ifdef TERMINAL_ENABLE process_terminal(keycode, record) && #endif -#ifdef CAPS_WORD_ENABLE - process_caps_word(keycode, record) && -#endif #ifdef SPACE_CADET_ENABLE process_space_cadet(keycode, record) && #endif From 5ca78fd7fb2472e217b895c897abfaffd03a679e Mon Sep 17 00:00:00 2001 From: QyuriLa Date: Mon, 30 May 2022 03:29:41 +0900 Subject: [PATCH 2/2] Fix Caps Word to work properly with Combo feature Processing Caps Word with only press events results in incompatibility with the Combo feature because not only some results of the combos but also some keys, which are part of the combos, make input with release events. --- quantum/process_keycode/process_caps_word.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/quantum/process_keycode/process_caps_word.c b/quantum/process_keycode/process_caps_word.c index ffd509a9142e..d4809a7f0171 100644 --- a/quantum/process_keycode/process_caps_word.c +++ b/quantum/process_keycode/process_caps_word.c @@ -83,7 +83,13 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) { #endif // CAPS_WORD_IDLE_TIMEOUT > 0 // From here on, we only take action on press events. - if (!record->event.pressed) { + // The exceptions are the combo results and the chord keys, + // which send keypress with a release event. + if (!record->event.pressed +#ifdef COMBO_ENABLE + && !caps_word_press_user(keycode) +#endif // COMBO_ENABLE + ) { return true; }