-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Caps Word not working with Auto Shift and Combo feature #17240
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm puzzled with how this logic mismatches the comment above it: "The exceptions are the combo results and the chord keys". As it is, the code is more like "We only take action on press events OR release events where caps_word_press_user() is true," which seems a lot broader than needed. To focus the change in behavior to combos, could something like this work? if (!record->event.pressed || IS_COMBOEVENT(record->event)) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also this workaround looks really strange — the combo code should generate the same press and release events as would be generated for normal keys, and handling the release event here would result in setting weak mods on the release event too, which does not look correct. So I wonder what is the real problem here. Maybe the real bug is in the combo code, or maybe some other code calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @getreuer I refered this section of the docs for the terms "combo result" and "chord key". For instance, // name result chord keys
COMB(AB_MINS, KC_MINS, KC_A, KC_B) when this combo is defined,
In order to work, the above code should be: if (!record->event.pressed && !IS_COMBOEVENT(record->event)) But this code won't completely fix the problem, because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I thought the same. What I found on debugging the current code -- before 5ca78fd -- is that when one of the "chord keys" is tapped, a keypress is actually passed through the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Some notable behavior about it is that, when some Mod-Tap keys are part of the "chord keys", they are shifted flawlessly with Caps Word on, even if you do not redefine |
||
#endif // COMBO_ENABLE | ||
) { | ||
return true; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a glance, I thought that there was just kind of event generated from the combos implementation, where it calls
process_record()
, but I'm no expert. Are "combo result" and "chord key" synonymous terms, or is there a difference?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm so sorry, I misclicked the "Resolve conversation" button for another conversation... Is there any way to undo resolving?
Edit: nevermind, I unresolved that.