Repository navigation
fix(CompositeDevice): Release axis direction keys when crossing center - #814
Merged
Merged
Conversation
Axis direction mappings only matched events on their own side of center, so a key mapped to a stick direction stayed held when the stick crossed center within a single report. Button targets of these mappings are now translated on both sides of center so they get released, relying on the existing active input tracking to drop redundant releases. Fixes ShadowBlip#813 Assisted-by: LLM
pastaq
approved these changes
Nov 20, 2026
Contributor
|
🎉 This PR is included in version 0.85.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or 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
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.
Fixes #813.
Axis-to-button mappings only matched events on their own side of center, so if the stick crossed center in a single report, the old direction never got released.
Now axis-to-button mappings get translated on both sides of center, so they can send the release. Some sources (like evdev) report X and Y separately, so an event without the mapped axis now translates to
InputValue::Noneinstead of a release. Otherwise a Y-only event would end up releasing a held left, for example.That means a lot of extra releases, so
handle_eventnow uses each translated event's own pressed state instead of the source's (always true for a Vector2). That wayis_new_active_eventdrops releases for keys that aren't held. If one direction releases a key another one presses in the same event, the release is dropped too.Chords are now limited to events from the same mapping. Otherwise left -> right counts as a chord, which would delay the right press, which in turn means that the next release can overtake it.
I tested this using the same method I explained in the issue (watching the virtual keyboard with evtest), as well as with a game where the previous behavior would lead to broken movement due to stuck directional keys.