pub struct InteractionEvent {
pub kind: InteractionEventKind,
pub pointer_kind: PointerKind,
pub screen_point: ScreenPoint,
pub query_coord: Option<GeoCoord>,
pub projection: Option<CameraProjection>,
pub button: Option<InteractionButton>,
pub modifiers: InteractionModifiers,
pub target: Option<InteractionTarget>,
pub related_target: Option<InteractionTarget>,
pub hit: Option<PickHit>,
}Expand description
Canonical interaction event payload.
Fields§
§kind: InteractionEventKindEvent kind.
pointer_kind: PointerKindInput device class that produced the event.
screen_point: ScreenPointLogical screen-space event location.
query_coord: Option<GeoCoord>Resolved geographic coordinate, when available.
projection: Option<CameraProjection>Camera projection active at dispatch time.
Pressed button for button-aware events.
modifiers: InteractionModifiersKeyboard-modifier snapshot at dispatch time.
target: Option<InteractionTarget>Current target of the interaction, when any.
Related target for enter/leave-style transitions, when any.
hit: Option<PickHit>Top-priority hit associated with the interaction, when any.
Implementations§
Source§impl InteractionEvent
impl InteractionEvent
Sourcepub fn new(
kind: InteractionEventKind,
pointer_kind: PointerKind,
screen_point: ScreenPoint,
) -> Self
pub fn new( kind: InteractionEventKind, pointer_kind: PointerKind, screen_point: ScreenPoint, ) -> Self
Create a new interaction event with no target or resolved hit attached.
Sourcepub fn with_query_coord(self, query_coord: GeoCoord) -> Self
pub fn with_query_coord(self, query_coord: GeoCoord) -> Self
Attach a resolved geographic query coordinate.
Sourcepub fn with_projection(self, projection: CameraProjection) -> Self
pub fn with_projection(self, projection: CameraProjection) -> Self
Attach the active camera projection.
Attach button metadata.
Sourcepub fn with_modifiers(self, modifiers: InteractionModifiers) -> Self
pub fn with_modifiers(self, modifiers: InteractionModifiers) -> Self
Attach keyboard modifiers.
Sourcepub fn with_hit(self, hit: PickHit) -> Self
pub fn with_hit(self, hit: PickHit) -> Self
Attach a top-priority pick hit and derive the current interaction target.
Attach a related target for enter/leave-style transitions.
Sourcepub fn has_target(&self) -> bool
pub fn has_target(&self) -> bool
Whether this event currently targets something queryable.
Trait Implementations§
Source§impl Clone for InteractionEvent
impl Clone for InteractionEvent
Source§fn clone(&self) -> InteractionEvent
fn clone(&self) -> InteractionEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more