[Feature] Send a dummy keycode to neutralize flashing modifiers in retro tap and key overrides #20992
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
Certain QMK features like Retro Tap and Key Overrides must unregister a previously registered modifier before sending a certain keycode but in doing so, the OS can sometimes misinterpret the intent of the user and trigger a keyboard shortcut when seeing the tap of modifier key. Notable examples are taps of the GUI key opening the start/applications menu in many desktop environments like Windows or Gnome or taps of the left Alt key focusing the menu bar in many GUI applications. This causes problems for the users of these features as described in issue #16795.
This PR aims to solve this issue by the neutralization of those flashing modifiers achieved through the tap of a dummy, user-configurable, keycode.
To illustrate; the idea is to send a keycode like Right Control so that the OS sees the following key events when retro-tapping
LGUI_T(KC_A):LGUI + RCtrl is an extremely rare keyboard shortcut which is unlikely to be bound to any action, so doing so amounts to a no-op and we can thus simply send "a" with no other side-effects, just as the user intended.
All the user has to do is to define two options in
config.h:with sensible defaults for
MODS_TO_NEUTRALIZEalready available.Types of Changes
Issues Fixed or Closed by This PR
RETRO_TAPPINGdoes not work withALT_T(*)#9230Checklist