Module gesture
Expand description
Pointer-driven selection gestures — the press → move → release state machine
behind click-to-place-caret, drag-to-select, double-click-word,
triple-click-line, and shift-extend. App-agnostic: it tracks the gesture and
reports intents (extend? what granularity?); the app maps points to its own
caret/selection model. Lives in ui so every app gets consistent selection
behaviour instead of re-deriving the timing/anchor rules.
Structs§
- Drag
Select - Tracks a text-selection drag gesture across press → move → release, including multi-click (word/line) and shift-extend.
- NavAvailability
- Which
NavDirections a widget subtree would consume right now. - NavGesture
Recognizer - Recognises back/forward navigation gestures from touchpad swipes and
touchscreen edge pulls. One instance lives on the
App; feed it every scroll and touch event and act on theSome(NavDirection)it returns. - Press
Intent - What a press should do to the selection.
- Touch
Gesture Arena - Resolves taps, pans, multi-finger swipes and pinches from raw direct-touch contacts. It reports continuous pan/pinch updates and at most one terminal tap or swipe. Long-press timing remains a host concern because it needs a frame/timer wake even when no touch event arrives.
Enums§
- Gesture
Phase - Phase of a continuous gesture, mapped from the windowing layer’s touch/scroll phases so this module stays winit-free and unit-testable.
- Granularity
- Selection granularity, from the click count.
- NavDirection
- The direction a recognised navigation gesture asks for.
- Touch
Gesture Event - Device-independent output of the direct-touch gesture arena. Widgets use this instead of interpreting raw contact streams, so a canvas, document or game surface gets the same slop, pinch and swipe arbitration.
- Touch
Swipe Direction
Functions§
- multi_
click_ interval - The current multi-click window.
- set_
multi_ click_ interval - Set the multi-click window for this session.