pub enum PointerEventKind {
Down,
Move,
Up,
ButtonDown(PointerButton),
ButtonUp(PointerButton),
Cancel,
Scroll,
Zoom,
RotaryScrollPre,
RotaryScroll,
Enter,
Exit,
}Expand description
What a pointer event reports.
Variants§
Down
A pointer went down: the primary mouse button, a finger or a pen
touched. Other mouse buttons arrive as
ButtonDown.
Move
A pointer moved.
Up
A pointer went up: the primary mouse button, a finger or a pen lifted.
ButtonDown(PointerButton)
A mouse button other than the primary one went down: the right, the
middle or a side button. A click, a drag or a scroll starts only from
Down; a handler that takes another button, such as one
that opens a menu or turns a camera, matches this. The nodes under the
pointer receive it, or, while another button is down, the nodes that
took that button’s press. Those nodes receive the moves until the
last button goes up, with the buttons held in
PointerEvent::buttons.
ButtonUp(PointerButton)
A mouse button other than the primary one went up; see
ButtonDown.
Cancel
The system canceled the gesture of the pointer.
Scroll
A wheel or trackpad scroll. The delta is in PointerEvent::scroll_delta.
Zoom
Discrete zoom step (desktop ctrl+wheel, browser pinch-trackpad).
The multiplicative factor is carried in PointerEvent::zoom_delta.
RotaryScrollPre
Rotary scroll (Wear OS crown / rotating bezel) during the capture pass, which runs root-to-focused so ancestors can intercept the event before the focused node sees it.
The scroll amounts are carried in PointerEvent::scroll_delta (y =
vertical pixels, x = horizontal pixels) and the rotary uptime in
PointerEvent::time_ms; use
PointerEvent::rotary_scroll_event to read them back as a
RotaryScrollEvent. Mirrors Compose’s onPreRotaryScrollEvent.
RotaryScroll
Rotary scroll during the bubble pass, which runs focused-to-root.
Mirrors Compose’s onRotaryScrollEvent.
Enter
A pointer began to hover over the receiving node.
Exit
A pointer stopped hovering over the receiving node.