Struct winit::event::Touch[][src]

pub struct Touch {
    pub device_id: DeviceId,
    pub phase: TouchPhase,
    pub location: PhysicalPosition<f64>,
    pub force: Option<Force>,
    pub id: u64,
}
Expand description

Represents a touch event

Every time the user touches the screen, a new Start event with an unique identifier for the finger is generated. When the finger is lifted, an End event is generated with the same finger id.

After a Start event has been emitted, there may be zero or more Move events when the finger is moved or the touch pressure changes.

The finger id may be reused by the system after an End event. The user should assume that a new Start event received with the same id has nothing to do with the old finger and is a new finger.

A Cancelled event is emitted when the system has canceled tracking this touch, such as when the window loses focus, or on iOS if the user moves the device against their face.

Fields

device_id: DeviceIdphase: TouchPhaselocation: PhysicalPosition<f64>force: Option<Force>
Expand description

Describes how hard the screen was pressed. May be None if the platform does not support pressure sensitivity.

Platform-specific

  • Only available on iOS 9.0+ and Windows 8+.
id: u64
Expand description

Unique identifier of a finger.

Trait Implementations

impl Clone for Touch[src]

fn clone(&self) -> Touch[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Touch[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<Touch> for Touch[src]

fn eq(&self, other: &Touch) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Touch) -> bool[src]

This method tests for !=.

impl Copy for Touch[src]

impl StructuralPartialEq for Touch[src]

Auto Trait Implementations

impl RefUnwindSafe for Touch

impl Send for Touch

impl Sync for Touch

impl Unpin for Touch

impl UnwindSafe for Touch

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.