Skip to main content

Module gesture

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§

DragSelect
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.
NavGestureRecognizer
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 the Some(NavDirection) it returns.
PressIntent
What a press should do to the selection.
TouchGestureArena
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§

GesturePhase
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.
TouchGestureEvent
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.
TouchSwipeDirection

Functions§

multi_click_interval
The current multi-click window.
set_multi_click_interval
Set the multi-click window for this session.