#[non_exhaustive]pub struct PointerEntry {
pub info: PointerInfo,
pub position: Point,
pub down_position: Point,
pub hovered: Option<WidgetId>,
pub captured_by: Option<WidgetId>,
pub hover_within: Vec<WidgetId>,
pub sequence: Option<PointerSequence>,
pub last_accepted: Option<WidgetId>,
}Expand description
Everything the tree tracks about one live pointer.
One of these exists from the pointer’s first sample until it lifts (a contact) or the window loses it (a hovering pointer never lifts, so a mouse’s entry persists for the life of the tree once it has been seen).
#[non_exhaustive]: the velocity tracker lands here in a later package
(the gesture-sequence handle already has), and it should not break a
construction site.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.info: PointerInfoWho this pointer is, as of its most recent sample.
position: PointWhere it is now, in window-logical coordinates.
down_position: PointWhere its most recent press landed. Equal to
position until the first press, so a slop test
against it is never nonsense.
hovered: Option<WidgetId>The widget it is hovering, if it is a hovering-capable pointer that
currently holds the hover-owner role. Always None for a contact.
captured_by: Option<WidgetId>The widget that captured this pointer. Capture is per pointer: two contacts hold independent captures, and each is released only by its own Up or Cancel.
hover_within: Vec<WidgetId>Strict ancestors of hovered whose hover_within
signal this pointer currently holds true.
sequence: Option<PointerSequence>The arbitration in progress for this pointer’s press: who is competing
for it, and who won. None between presses — a hovering mouse has an
entry but no sequence. See
PointerSequence.
last_accepted: Option<WidgetId>The last widget that answered Handled to one of this pointer’s
positional events.
The fallback recipient of a
PointerCancel when the
pointer holds no capture: something was interacting with this pointer,
and it is the only thing the tree can name. Kept per pointer rather
than per tree, because two contacts on two widgets each have their own
answer.
Implementations§
Source§impl PointerEntry
impl PointerEntry
Sourcepub fn hovers(&self) -> bool
pub fn hovers(&self) -> bool
Whether this pointer can report a position without a button held, and
so can own hover. See PointerKind::hovers.
Sourcepub fn is_contacting(&self) -> bool
pub fn is_contacting(&self) -> bool
Whether this pointer is touching the surface: a contact is touching for as long as it is live, a hovering-capable pointer only while a button is held.