pub struct WebEventPointer {
pub x: js_number,
pub y: js_number,
pub pressure: js_number,
pub id: js_int32,
pub tilt_x: i8,
pub tilt_y: i8,
pub twist: u16,
pub buttons: u8,
pub mods: KeyMods,
pub etype: WebEventKind,
pub timestamp: JsInstant,
/* private fields */
}event and web only.Expand description
๐ซ ๐ A web API Pointer Event.
๐ sys/os/browser/web
๐ฆ size_of::<WebEventPointer>() == 48 bytes / 384 bits
โ๏ธOption<T>
Represents a JavaScript pointer event containing relevant properties.
ยงCompatibility
Some Firefox/Linux configurations may report stylus input as
pointerType = "mouse" with pressure = 0.5 and zero tilt.
That is the browser/platform fallback stream.
Fieldsยง
ยงx: js_numberThe X-coordinate of the pointer event relative to the viewport.
y: js_numberThe Y-coordinate of the pointer event relative to the viewport.
pressure: js_numberThe pressure applied to the pointer (0.0 to 1.0 for most devices).
id: js_int32Unique identifier for the pointer device.
tilt_x: i8The tilt of the stylus along the X-axis (-90ยฐ to 90ยฐ).
tilt_y: i8The tilt of the stylus along the Y-axis (-90ยฐ to 90ยฐ).
twist: u16The rotation of the stylus around its own axis (0ยฐ to 359ยฐ).
A bitmask of buttons currently being held down during the pointer event.
mods: KeyModsA bitmask of active keyboard modifiers during the pointer event.
etype: WebEventKindThe type of pointer event (PointerDown, PointerMove, etc.).
timestamp: JsInstantThe JavaScript event timestamp.
Implementationsยง
Sourceยงimpl WebEventPointer
impl WebEventPointer
Sourcepub const fn new(
x: js_number,
y: js_number,
pressure: js_number,
id: js_int32,
tilt_x: i8,
tilt_y: i8,
twist: u16,
kind: EventPointerKind,
button: u8,
buttons: u8,
mods: KeyMods,
etype: WebEventKind,
timestamp: JsInstant,
) -> Self
pub const fn new( x: js_number, y: js_number, pressure: js_number, id: js_int32, tilt_x: i8, tilt_y: i8, twist: u16, kind: EventPointerKind, button: u8, buttons: u8, mods: KeyMods, etype: WebEventKind, timestamp: JsInstant, ) -> Self
Returns a new WebEventPointer.
Sourcepub const fn kind(self) -> EventPointerKind
pub const fn kind(self) -> EventPointerKind
Returns the pointer-device kind.
Sourcepub const fn with_kind(self, kind: EventPointerKind) -> Self
pub const fn with_kind(self, kind: EventPointerKind) -> Self
Returns self with the pointer-device kind replaced.
Returns the normalized triggering button, or None when no button changed.
Returns the raw DOM-compatible button value.
Returns 255 for DOM button = -1, meaning no button changed.
Returns self with the normalized triggering button replaced.
Returns self with the raw DOM-compatible button value replaced.
Sourceยงimpl WebEventPointer
impl WebEventPointer
Sourcepub const fn to_kind_timed(self) -> EventKindTimed
pub const fn to_kind_timed(self) -> EventKindTimed
Converts WebEventPointer to EventKindTimed.
Sourcepub const fn from_event_pointer_timed(
from: Timed<EventPointer, Option<EventTimestamp>>,
) -> WebEventPointer
pub const fn from_event_pointer_timed( from: Timed<EventPointer, Option<EventTimestamp>>, ) -> WebEventPointer
Converts a timed normalized EventPointer back to WebEventPointer.
Trait Implementationsยง
Sourceยงimpl Clone for WebEventPointer
impl Clone for WebEventPointer
Sourceยงfn clone(&self) -> WebEventPointer
fn clone(&self) -> WebEventPointer
1.0.0 (const: unstable) ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WebEventPointer
Sourceยงimpl Debug for WebEventPointer
impl Debug for WebEventPointer
Sourceยงimpl From<Timed<EventPointer, Option<EventTimestamp>>> for WebEventPointer
impl From<Timed<EventPointer, Option<EventTimestamp>>> for WebEventPointer
Sourceยงfn from(from: Timed<EventPointer, Option<EventTimestamp>>) -> Self
fn from(from: Timed<EventPointer, Option<EventTimestamp>>) -> Self
Sourceยงimpl From<WebEventPointer> for EventKindTimed
impl From<WebEventPointer> for EventKindTimed
Sourceยงfn from(from: WebEventPointer) -> Self
fn from(from: WebEventPointer) -> Self
Sourceยงimpl PartialEq for WebEventPointer
impl PartialEq for WebEventPointer
Sourceยงfn eq(&self, other: &WebEventPointer) -> bool
fn eq(&self, other: &WebEventPointer) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WebEventPointer
Auto Trait Implementationsยง
impl Freeze for WebEventPointer
impl RefUnwindSafe for WebEventPointer
impl Send for WebEventPointer
impl Sync for WebEventPointer
impl Unpin for WebEventPointer
impl UnsafeUnpin for WebEventPointer
impl UnwindSafe for WebEventPointer
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.