2019-11-11 20:29:58 -08:00
|
|
|
//! Build touch events.
|
2020-03-19 12:17:16 +01:00
|
|
|
use crate::Point;
|
|
|
|
|
|
|
|
|
|
/// A touch interaction.
|
2019-11-11 20:29:58 -08:00
|
|
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
2020-12-15 06:38:46 +01:00
|
|
|
#[allow(missing_docs)]
|
|
|
|
|
pub enum Event {
|
2020-03-19 12:17:16 +01:00
|
|
|
/// A touch interaction was started.
|
2020-12-15 06:38:46 +01:00
|
|
|
FingerPressed { id: Finger, position: Point },
|
2020-03-19 12:17:16 +01:00
|
|
|
|
|
|
|
|
/// An on-going touch interaction was moved.
|
2020-12-15 06:38:46 +01:00
|
|
|
FingerMoved { id: Finger, position: Point },
|
2020-03-19 12:17:16 +01:00
|
|
|
|
|
|
|
|
/// A touch interaction was ended.
|
2020-12-15 06:38:46 +01:00
|
|
|
FingerLifted { id: Finger, position: Point },
|
2020-03-19 12:17:16 +01:00
|
|
|
|
|
|
|
|
/// A touch interaction was canceled.
|
2020-12-15 06:38:46 +01:00
|
|
|
FingerLost { id: Finger, position: Point },
|
2019-11-11 20:29:58 -08:00
|
|
|
}
|
2020-12-15 06:38:46 +01:00
|
|
|
|
|
|
|
|
/// A unique identifier representing a finger on a touch interaction.
|
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
|
|
|
|
pub struct Finger(pub u64);
|