Skip to main content

GestureRecognizer

Struct GestureRecognizer 

Source
pub struct GestureRecognizer {
    pub required_finger_count: usize,
    pub requires_exact_finger_count_to_continue: bool,
    pub disallow_activation_from_finger_count_decrease: bool,
    pub recognized_gesture_types: GestureTypes,
    pub minimum_swipe_translation: f32,
    pub minimum_magnification_distance: f32,
    pub minimum_rotation: f32,
    pub inactivity_timeout: Duration,
    /* private fields */
}

Fields§

§required_finger_count: usize§requires_exact_finger_count_to_continue: bool§disallow_activation_from_finger_count_decrease: bool§recognized_gesture_types: GestureTypes§minimum_swipe_translation: f32§minimum_magnification_distance: f32§minimum_rotation: f32§inactivity_timeout: Duration

Implementations§

Source§

impl GestureRecognizer

Source

pub fn new(finger_count: usize) -> Self

Source

pub fn with_gesture_types(self, types: GestureTypes) -> Self

Source

pub fn with_exact_finger_count(self, exact: bool) -> Self

Source

pub fn process(&mut self, contacts: &[Contact]) -> Option<GestureEvent>

Source

pub fn reset(&mut self) -> Option<GestureEvent>

Source

pub fn timeout(&mut self) -> Option<GestureEvent>

Source

pub fn events_from_device(self, device: &Device) -> GestureStream ⓘ

Spawn a gesture stream from one multitouch device.

Source

pub fn events_from_monitor(self, monitor: &Monitor) -> GestureStream ⓘ

Spawn a gesture stream from a monitor. Frames from every monitored multitouch device are fed into this recognizer.

Source

pub fn events_from_receiver( self, receiver: Receiver<Vec<Contact>>, ) -> GestureStream ⓘ

Trait Implementations§

Source§

impl Debug for GestureRecognizer

Source§

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

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

impl Default for GestureRecognizer

Source§

fn default() -> Self

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

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> 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, 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.