Skip to content

Clear weak mods before processing queued keypresses in tap-hold handling#26214

Open
windexlight wants to merge 2 commits into
qmk:developfrom
windexlight:clear-weak-mods-tapping-buffer
Open

Clear weak mods before processing queued keypresses in tap-hold handling#26214
windexlight wants to merge 2 commits into
qmk:developfrom
windexlight:clear-weak-mods-tapping-buffer

Conversation

@windexlight

Copy link
Copy Markdown
Contributor

Description

In action_exec(), there is a bit of code that clears weak mods left over from previous keypresses, so they do not affect new keypresses. However, tap-hold handling code buffers events so that they can be processed after a tap-hold decision is settled. The processing of these buffered events bypasses action_exec(), so weak mods from a keypress in the buffer can affect those processed later in the buffer. This can manifest when activating a layer with LT, and then rapidly typing a modified keycode followed by a non-modified keycode within the tapping term. Example: trying to type != and getting !+ instead.

Have implemented a fix by clearing weak mods before passing buffered records on for processing.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Fixes sending modified keycodes erroneously when, for example,
activiting a layer with LT, and then rapidly typing a modified keycode
followed by a non-modified keycode within the tapping term. Example:
trying to type != and getting !+ instead.
@github-actions github-actions Bot added the core label May 16, 2026
@drashna drashna requested a review from a team May 17, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants