Skip to content

triggers/swipe: add lock_direction - #84

Open
Owen271 wants to merge 1 commit into
InputActions:mainfrom
Owen271:lock-direction
Open

Owen271 wants to merge 1 commit into
InputActions:mainfrom
Owen271:lock-direction

Conversation

@Owen271

@Owen271 Owen271 commented Nov 10, 2026 •

Copy link
Copy Markdown

Swipe triggers are cancelled when the averaged angle leaves their range, which allows chaining. For gestures that should run a single action per swipe this misfires: wobbling during an up swipe toggles Overview twice, and a held Alt+Tab swipe is cancelled as soon as it turns.

lock_direction: true checks the angle only until the trigger starts; after that the trigger stays active until the gesture ends. Speed and thresholds are still checked, and a gesture resumed with resume_timeout must match the angle again. Defaults to false, so existing configs are unaffected.

A matching wiki change is ready; I'll open it if this is accepted. Happy to rework it to fit with InputActions/discussions#272.

@Owen271
Owen271 force-pushed the lock-direction branch 2 times, most recently from 1587792 to f6202b5 Compare November 11, 2026 07:59
@Owen271
Owen271 marked this pull request as ready for review November 11, 2026 07:59
Once a swipe trigger with lock_direction has started, its angle is no
longer checked, so it stays active until the gesture ends instead of being
cancelled and chained into another trigger when the direction changes.
Speed is still checked. A gesture resumed with resume_timeout must match
the angle again before the lock applies. Defaults to false.

Adds TriggerCore::canContinue, which Trigger::canUpdate uses once the
trigger has been updated during the current gesture; the default
implementation calls canUpdate, so other triggers are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant