pub struct PointerEvent {
pub event_time: u64,
pub device_id: u32,
pub pointer_id: u32,
pub type_: PointerEventType,
pub phase: PointerEventPhase,
pub x: f32,
pub y: f32,
pub radius_major: f32,
pub radius_minor: f32,
pub buttons: u32,
}
Expand description
Pointers represent raw data about the user’s interaction with the screen.
The state transitions should be as follows: ADD (-> HOVER) -> DOWN -> MOVE -> UP (-> HOVER) -> REMOVE
At any point after the initial ADD, a transition to CANCEL is also possible.
Fields§
§event_time: u64
Time the event was delivered. The time is in nanoseconds and corresponds to the monotonic time as determined by the zx_clock_get_monotonic syscall.
device_id: u32
§pointer_id: u32
§type_: PointerEventType
§phase: PointerEventPhase
§x: f32
x
and y
are in the coordinate system of the View.
y: f32
§radius_major: f32
§radius_minor: f32
Currently pressed buttons as defined the kButton constants such as
kMousePrimaryButton
Trait Implementations§
Source§impl Clone for PointerEvent
impl Clone for PointerEvent
Source§fn clone(&self) -> PointerEvent
fn clone(&self) -> PointerEvent
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PointerEvent
impl Debug for PointerEvent
Source§impl<D: ResourceDialect> Decode<PointerEvent, D> for PointerEvent
impl<D: ResourceDialect> Decode<PointerEvent, D> for PointerEvent
Source§impl<D: ResourceDialect> Encode<PointerEvent, D> for &PointerEvent
impl<D: ResourceDialect> Encode<PointerEvent, D> for &PointerEvent
Source§impl<D: ResourceDialect, T0: Encode<u64, D>, T1: Encode<u32, D>, T2: Encode<u32, D>, T3: Encode<PointerEventType, D>, T4: Encode<PointerEventPhase, D>, T5: Encode<f32, D>, T6: Encode<f32, D>, T7: Encode<f32, D>, T8: Encode<f32, D>, T9: Encode<u32, D>> Encode<PointerEvent, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
impl<D: ResourceDialect, T0: Encode<u64, D>, T1: Encode<u32, D>, T2: Encode<u32, D>, T3: Encode<PointerEventType, D>, T4: Encode<PointerEventPhase, D>, T5: Encode<f32, D>, T6: Encode<f32, D>, T7: Encode<f32, D>, T8: Encode<f32, D>, T9: Encode<u32, D>> Encode<PointerEvent, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
Source§impl PartialEq for PointerEvent
impl PartialEq for PointerEvent
Source§impl PartialOrd for PointerEvent
impl PartialOrd for PointerEvent
Source§impl TypeMarker for PointerEvent
impl TypeMarker for PointerEvent
Source§type Owned = PointerEvent
type Owned = PointerEvent
The owned Rust type which this FIDL type decodes into.
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for PointerEvent
impl ValueTypeMarker for PointerEvent
Source§type Borrowed<'a> = &'a PointerEvent
type Borrowed<'a> = &'a PointerEvent
The Rust type to use for encoding. This is a particular
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for PointerEvent
impl Persistable for PointerEvent
impl StructuralPartialEq for PointerEvent
Auto Trait Implementations§
impl Freeze for PointerEvent
impl RefUnwindSafe for PointerEvent
impl Send for PointerEvent
impl Sync for PointerEvent
impl Unpin for PointerEvent
impl UnwindSafe for PointerEvent
Blanket Implementations§
§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
The marker type to use when the body is at the top-level.
§type MarkerInResultUnion = T
type MarkerInResultUnion = T
The marker type to use when the body is nested in a result union.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)