pub struct TouchRouter<F> { /* private fields */ }Expand description
Routes the fingers on one surface to the shell’s primary and secondary
pointers. F is the platform’s identity of a finger. None stands for
a mouse, which always drives the primary pointer.
Each method returns whether the shell changed and needs a frame.
Implementations§
Source§impl<F: Copy + Eq> TouchRouter<F>
impl<F: Copy + Eq> TouchRouter<F>
Sourcepub fn press<R>(
&mut self,
shell: &mut AppShell<R>,
finger: Option<F>,
x: f32,
y: f32,
) -> bool
pub fn press<R>( &mut self, shell: &mut AppShell<R>, finger: Option<F>, x: f32, y: f32, ) -> bool
A finger, or the mouse, went down at (x, y) in logical pixels.
Sourcepub fn moved<R>(
&self,
shell: &mut AppShell<R>,
finger: Option<F>,
x: f32,
y: f32,
) -> bool
pub fn moved<R>( &self, shell: &mut AppShell<R>, finger: Option<F>, x: f32, y: f32, ) -> bool
A finger, or the mouse, moved to (x, y). A finger that is not down
moves nothing.
Sourcepub fn release<R>(
&mut self,
shell: &mut AppShell<R>,
finger: Option<F>,
x: f32,
y: f32,
) -> bool
pub fn release<R>( &mut self, shell: &mut AppShell<R>, finger: Option<F>, x: f32, y: f32, ) -> bool
A finger, or the mouse, lifted at (x, y). The primary finger’s
lift ends the gesture: the secondary fingers are released first,
there, and the next finger down drives the primary pointer.
Sourcepub fn cancel<R>(
&mut self,
shell: &mut AppShell<R>,
finger: Option<F>,
position: Option<(f32, f32)>,
) -> bool
pub fn cancel<R>( &mut self, shell: &mut AppShell<R>, finger: Option<F>, position: Option<(f32, f32)>, ) -> bool
A finger, or the mouse, left without lifting: the system took the
touch, or it left the surface. The primary finger’s leaving cancels
the gesture. A secondary finger is released at position, or at the
origin when the platform gives none.