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.
impl TouchPointerTracker
Multi-touch pointer lifecycle tracking and cancellation helpers for TouchPointerTracker.
Sourcepub fn active_ids(&self) -> &[u64]
pub fn active_ids(&self) -> &[u64]
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Sourcepub fn map_android_pointer_id(raw_id: i32) -> u64
pub fn map_android_pointer_id(raw_id: i32) -> u64
Sourcepub fn handle_android_motion(
&mut self,
wid: WindowId,
action_masked: i32,
action_index: usize,
pointers: &[(i32, f32, f32)],
) -> Vec<WindowEvent>
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 byMotionEvent.getActionIndex().&[(i32, f32, f32)]- Active pointer tuples(raw_pointer_id, logical_x, logical_y)in index order.
§Returns
Vec<WindowEvent>- Ordered events to dispatch toApp.
Sourcepub fn handle_ios_touches_began(
&mut self,
wid: WindowId,
touches: &[(u64, f32, f32)],
) -> Vec<WindowEvent>
pub fn handle_ios_touches_began( &mut self, wid: WindowId, touches: &[(u64, f32, f32)], ) -> Vec<WindowEvent>
Sourcepub fn handle_ios_touches_cancelled(
&mut self,
wid: WindowId,
cancelled_ids: &[u64],
remaining_live_ids: &[u64],
) -> Vec<WindowEvent>
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 fromUIEvent.allTouches.
§Returns
Vec<WindowEvent>- OrderedPointerCancelevents.
Sourcepub fn cancel_all_on_focus_loss(&mut self, wid: WindowId) -> Vec<WindowEvent>
pub fn cancel_all_on_focus_loss(&mut self, wid: WindowId) -> Vec<WindowEvent>
Trait Implementations§
Source§impl Clone for TouchPointerTracker
impl Clone for TouchPointerTracker
Source§impl Debug for TouchPointerTracker
impl Debug for TouchPointerTracker
Source§impl Default for TouchPointerTracker
impl Default for TouchPointerTracker
Source§impl PartialEq for TouchPointerTracker
impl PartialEq for TouchPointerTracker
impl StructuralPartialEq for TouchPointerTracker
Auto Trait Implementations§
impl Forget for TouchPointerTracker
impl Freeze for TouchPointerTracker
impl Move for TouchPointerTracker
impl RefUnwindSafe for TouchPointerTracker
impl Send for TouchPointerTrackerwhere
RawVecInner: Send,
impl Sync for TouchPointerTrackerwhere
RawVecInner: Sync,
impl Unpin for TouchPointerTracker
impl UnsafeUnpin for TouchPointerTracker
impl UnwindSafe for TouchPointerTrackerwhere
RawVecInner: UnwindSafe,
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
Mutably borrows from an owned value. Read more