Skip to main content

TouchPointerTracker

Struct TouchPointerTracker 

Source
pub struct TouchPointerTracker { /* private fields */ }
Expand description

Platform-side active touch contact tracker normalizing Android MotionEvent and iOS UITouch cancellation lifecycles.

Implementations§

Source§

impl TouchPointerTracker

Multi-touch pointer lifecycle tracking and cancellation helpers for TouchPointerTracker.

Source

pub fn active_ids(&self) -> &[u64]

Returns the currently active mapped pointer identifiers.

§Arguments
  • &Self - Tracker reference.
§Returns
  • &[u64] - Slice of active pointer IDs.
Source

pub fn active_count(&self) -> usize

Returns the count of currently active touch pointers.

§Arguments
  • &Self - Tracker reference.
§Returns
  • usize - Active pointer count.
Source

pub fn map_android_pointer_id(raw_id: i32) -> u64

Maps an Android MotionEvent raw pointer ID (>= 0) to a non-zero euv pointer identifier (>= 1).

§Arguments
  • i32 - Android pointer identifier.
§Returns
  • u64 - Non-zero mapped pointer identifier.
Source

pub fn handle_android_motion( &mut self, wid: WindowId, action_masked: i32, action_index: usize, pointers: &[(i32, f32, f32)], ) -> Vec<WindowEvent>

Translates an Android MotionEvent (action_masked, action_index, pointers) into normalized WindowEvents.

§Arguments
  • &Self - Mutable tracker.
  • WindowId - Target window handle.
  • i32 - Masked Android motion action (ACTION_DOWN, ACTION_POINTER_DOWN, ACTION_MOVE, ACTION_POINTER_UP, ACTION_UP, ACTION_CANCEL).
  • usize - Pointer index reported by MotionEvent.getActionIndex().
  • &[(i32, f32, f32)] - Active pointer tuples (raw_pointer_id, logical_x, logical_y) in index order.
§Returns
  • Vec<WindowEvent> - Ordered events to dispatch to App.
Source

pub fn handle_ios_touches_began( &mut self, wid: WindowId, touches: &[(u64, f32, f32)], ) -> Vec<WindowEvent>

Records iOS touchesBegan contacts and produces corresponding PointerDown events.

§Arguments
  • &Self - Mutable tracker.
  • WindowId - Target window handle.
  • &[(u64, f32, f32)] - Touch tuples (pointer_id, logical_x, logical_y).
§Returns
  • Vec<WindowEvent> - PointerDown events.
Source

pub fn handle_ios_touches_cancelled( &mut self, wid: WindowId, cancelled_ids: &[u64], remaining_live_ids: &[u64], ) -> Vec<WindowEvent>

Handles iOS touchesCancelled, emitting PointerCancel for every cancelled and stale contact.

§Arguments
  • &Self - Mutable tracker.
  • WindowId - Target window handle.
  • &[u64] - Cancelled touch pointer identifiers.
  • &[u64] - Remaining active touch pointer identifiers from UIEvent.allTouches.
§Returns
  • Vec<WindowEvent> - Ordered PointerCancel events.
Source

pub fn cancel_all_on_focus_loss(&mut self, wid: WindowId) -> Vec<WindowEvent>

Cancels all active touches on focus loss, pause, or window detachment so input never wedges.

§Arguments
  • &Self - Mutable tracker.
  • WindowId - Target window handle.
§Returns
  • Vec<WindowEvent> - Per-pointer and global PointerCancel events (empty if no contacts were active).

Trait Implementations§

Source§

impl Clone for TouchPointerTracker

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TouchPointerTracker

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TouchPointerTracker

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for TouchPointerTracker

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TouchPointerTracker

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.