pub struct BlitzPointerEvent {
pub id: BlitzPointerId,
pub is_primary: bool,
pub coords: PointerCoords,
pub button: MouseEventButton,
pub buttons: MouseEventButtons,
pub mods: Modifiers,
pub details: PointerDetails,
pub element: Point<f32>,
pub active_pointers: Arc<AtomicRefCell<Vec<BlitzPointerEvent>>>,
}Fields§
§id: BlitzPointerId§is_primary: bool§coords: PointerCoords§mods: Modifiers§details: PointerDetails§element: Point<f32>§active_pointers: Arc<AtomicRefCell<Vec<BlitzPointerEvent>>>All pointers that are currently active (pressed) on the surface, including the one that triggered this event.
This is shared via Arc so that it can be cheaply cloned into each
dispatched event and cheaply mutated as pointers are pressed, moved and
released. It is primarily used to populate the touches list of touch
events (multi-touch support).
The events stored in this list always have an empty active_pointers
list themselves, to avoid a reference cycle.
Implementations§
Source§impl BlitzPointerEvent
impl BlitzPointerEvent
Sourcepub fn at(x: f32, y: f32, buttons: MouseEventButtons) -> BlitzPointerEvent
pub fn at(x: f32, y: f32, buttons: MouseEventButtons) -> BlitzPointerEvent
A synthetic primary-mouse event at a viewport coordinate.
For callers driving a document programmatically (a test, a debug
control surface, an agent) rather than translating a real device event.
The twelve-field literal this replaces is currently hand-rolled in
blitz-shell, blitz-script and dioxus-native-dom, each with its own
idea of the defaults.
screen, page and client all take the same value: a synthetic event
has no window offset or scroll origin to distinguish them. element is
left at the origin because the offset within the target is only known
after hit-testing, which the document does when the event is dispatched.
pub fn is_mouse(&self) -> bool
pub fn is_pen(&self) -> bool
pub fn is_finger(&self) -> bool
pub fn page_x(&self) -> f32
pub fn page_y(&self) -> f32
pub fn client_x(&self) -> f32
pub fn client_y(&self) -> f32
pub fn screen_x(&self) -> f32
pub fn screen_y(&self) -> f32
pub fn element_x(&self) -> f32
pub fn element_y(&self) -> f32
Trait Implementations§
Source§impl Clone for BlitzPointerEvent
impl Clone for BlitzPointerEvent
Source§fn clone(&self) -> BlitzPointerEvent
fn clone(&self) -> BlitzPointerEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for BlitzPointerEvent
impl !UnwindSafe for BlitzPointerEvent
impl Freeze for BlitzPointerEvent
impl Send for BlitzPointerEvent
impl Sync for BlitzPointerEvent
impl Unpin for BlitzPointerEvent
impl UnsafeUnpin for BlitzPointerEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more