Repository navigation
Conversation
Converts two-axis motion into discrete actions, for navigating grid-like UIs such as the window switcher with a single swipe. Every time the motion along the dominant axis reaches the distance (default 75), the action for that direction is executed. Reversing direction or switching axis restarts accumulation, and at most 8 actions are executed per update. Each direction takes any action, with its own conditions and limit. Input actions among them enable the trigger's default modifier clearing. The directional action must be the action of an update action without an interval, so it cannot be in a group or have a limit. Updates without motion are ignored until the first motion, since only swipe triggers provide two-axis motion. - initial: actions executed on the first update with motion, using the swipe angle, instead of waiting for the distance. - repeat_conditions: checked on the main thread before executing each action. While not satisfied, motion is discarded. If satisfied on the first update with motion, the initial action is skipped. Motion is processed on the main thread. Synchronous actions are executed right after the repeat condition is checked, even if the action thread is busy, so input cannot reach an application after the navigated UI has closed. Asynchronous actions are scheduled on the action thread instead of blocking the main thread. Motion queued behind a busy action thread is posted to the main thread without blocking, so reloading the configuration cannot deadlock. Swipe triggers now pass their average angle to actions as inputActionArgs.motionAngle.
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.
Navigating a grid-like UI, such as the window switcher or a grid of virtual desktops, with one continuous swipe isn't possible today: an
intervalrepeats one action along one axis, and separate triggers per direction end or chain as soon as the swipe turns.directionalruns the action for a direction each time the motion along the dominant axis reachesdistance. Each direction takes any action,initialruns on the first motion, andrepeat_conditionsstops further steps once the navigated UI has closed.A matching wiki change is ready; I'll open it if this is accepted.