-
-
Notifications
You must be signed in to change notification settings - Fork 40.5k
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
Do not leak weak mods from tap dance to the interrupting keypress #12471
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tap dance callbacks may register weak mods; one case when it happens is when a tap dance registers a key with modifiers. When the tap dance is interrupted by pressing another key, these weak mods could affect the interrupting key (normally any stale weak mods are cleared at the start of action_exec() when handling a keypress event, but the tap dance interrupt check code is called later, and the weak mods left by that code were not cleared). Add another clear_weak_mods() call to preprocess_tap_dance() to make sure that the interrupting keypress is not affected by unrelated weak mods from the previous tap dance. Fixes qmk#12445.
spidey3
approved these changes
Apr 18, 2021
drashna
approved these changes
Apr 18, 2021
makenova
pushed a commit
to makenova/qmk_firmware
that referenced
this pull request
Apr 26, 2021
…k#12471) Tap dance callbacks may register weak mods; one case when it happens is when a tap dance registers a key with modifiers. When the tap dance is interrupted by pressing another key, these weak mods could affect the interrupting key (normally any stale weak mods are cleared at the start of action_exec() when handling a keypress event, but the tap dance interrupt check code is called later, and the weak mods left by that code were not cleared). Add another clear_weak_mods() call to preprocess_tap_dance() to make sure that the interrupting keypress is not affected by unrelated weak mods from the previous tap dance. Fixes qmk#12445.
rizo
pushed a commit
to rizo/qmk_firmware
that referenced
this pull request
May 10, 2021
…k#12471) Tap dance callbacks may register weak mods; one case when it happens is when a tap dance registers a key with modifiers. When the tap dance is interrupted by pressing another key, these weak mods could affect the interrupting key (normally any stale weak mods are cleared at the start of action_exec() when handling a keypress event, but the tap dance interrupt check code is called later, and the weak mods left by that code were not cleared). Add another clear_weak_mods() call to preprocess_tap_dance() to make sure that the interrupting keypress is not affected by unrelated weak mods from the previous tap dance. Fixes qmk#12445.
toddyamakawa
pushed a commit
to toddyamakawa/qmk_firmware
that referenced
this pull request
May 19, 2021
…k#12471) Tap dance callbacks may register weak mods; one case when it happens is when a tap dance registers a key with modifiers. When the tap dance is interrupted by pressing another key, these weak mods could affect the interrupting key (normally any stale weak mods are cleared at the start of action_exec() when handling a keypress event, but the tap dance interrupt check code is called later, and the weak mods left by that code were not cleared). Add another clear_weak_mods() call to preprocess_tap_dance() to make sure that the interrupting keypress is not affected by unrelated weak mods from the previous tap dance. Fixes qmk#12445.
HokieGeek
pushed a commit
to HokieGeek/qmk_firmware
that referenced
this pull request
Jul 11, 2021
…k#12471) Tap dance callbacks may register weak mods; one case when it happens is when a tap dance registers a key with modifiers. When the tap dance is interrupted by pressing another key, these weak mods could affect the interrupting key (normally any stale weak mods are cleared at the start of action_exec() when handling a keypress event, but the tap dance interrupt check code is called later, and the weak mods left by that code were not cleared). Add another clear_weak_mods() call to preprocess_tap_dance() to make sure that the interrupting keypress is not affected by unrelated weak mods from the previous tap dance. Fixes qmk#12445.
3 tasks
BorisTestov
pushed a commit
to BorisTestov/qmk_firmware
that referenced
this pull request
May 23, 2024
…k#12471) Tap dance callbacks may register weak mods; one case when it happens is when a tap dance registers a key with modifiers. When the tap dance is interrupted by pressing another key, these weak mods could affect the interrupting key (normally any stale weak mods are cleared at the start of action_exec() when handling a keypress event, but the tap dance interrupt check code is called later, and the weak mods left by that code were not cleared). Add another clear_weak_mods() call to preprocess_tap_dance() to make sure that the interrupting keypress is not affected by unrelated weak mods from the previous tap dance. Fixes qmk#12445.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Tap dance callbacks may register weak mods; one case when it happens is when a tap dance registers a key with modifiers. When the tap dance is interrupted by pressing another key, these weak mods could affect the interrupting key (normally any stale weak mods are cleared at the start of
action_exec()
when handling a keypress event, but the tap dance interrupt check code is called later, and the weak mods left by that code were not cleared). Add anotherclear_weak_mods()
call topreprocess_tap_dance()
to make sure that the interrupting keypress is not affected by unrelated weak mods from the previous tap dance.One example of a tap dance which exhibits the problem and can be used with the US QWERTY layout (unlike the example from #12445, which assumes the US International layout):
Before the fix, pressing that tap dance key and then immediately pressing another key without releasing the tap dance key would result in the Shift modifier from
KC_LPRN
(which is actuallyS(KC_9)
) getting applied to the second key.This use case was broken by PR #9941, but just reverting that PR is not the correct solution, because it fixed another set of problems with weak mods. In particular, a reset before
preprocess_tap_dance()
is also required, so that any stale weak mods won't affect the keys which are registered by the tap dance itself.Types of Changes
Issues Fixed or Closed by This PR
Checklist