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: Renderer<Error: Debug>>(
&mut self,
shell: &mut AppShell<R>,
finger: Option<F>,
sample: TouchSample,
) -> bool
pub fn press<R: Renderer<Error: Debug>>( &mut self, shell: &mut AppShell<R>, finger: Option<F>, sample: TouchSample, ) -> bool
A finger, or the mouse, went down at sample.
Sourcepub fn moved<R: Renderer<Error: Debug>>(
&self,
shell: &mut AppShell<R>,
finger: Option<F>,
sample: TouchSample,
) -> bool
pub fn moved<R: Renderer<Error: Debug>>( &self, shell: &mut AppShell<R>, finger: Option<F>, sample: TouchSample, ) -> bool
A finger, or the mouse, moved to sample. A finger that is not down
moves nothing.
Sourcepub fn release<R: Renderer<Error: Debug>>(
&mut self,
shell: &mut AppShell<R>,
finger: Option<F>,
sample: TouchSample,
) -> bool
pub fn release<R: Renderer<Error: Debug>>( &mut self, shell: &mut AppShell<R>, finger: Option<F>, sample: TouchSample, ) -> bool
A finger, or the mouse, lifted at sample. 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: Renderer<Error: Debug>>(
&mut self,
shell: &mut AppShell<R>,
finger: Option<F>,
position: Option<(f32, f32)>,
) -> bool
pub fn cancel<R: Renderer<Error: Debug>>( &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.