summaryrefslogtreecommitdiffstats
path: root/native/src/touch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/touch.rs')
-rw-r--r--native/src/touch.rs32
1 files changed, 10 insertions, 22 deletions
diff --git a/native/src/touch.rs b/native/src/touch.rs
index 88bd83bb..18120644 100644
--- a/native/src/touch.rs
+++ b/native/src/touch.rs
@@ -3,33 +3,21 @@ use crate::Point;
/// A touch interaction.
#[derive(Debug, Clone, Copy, PartialEq)]
-pub struct Touch {
- /// The finger of the touch.
- pub finger: Finger,
-
- /// The position of the touch.
- pub position: Point,
-
- /// The state of the touch.
- pub phase: Phase,
-}
-
-/// A unique identifier representing a finger on a touch interaction.
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
-pub struct Finger(pub u64);
-
-/// The state of a touch interaction.
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum Phase {
+#[allow(missing_docs)]
+pub enum Event {
/// A touch interaction was started.
- Started,
+ FingerPressed { id: Finger, position: Point },
/// An on-going touch interaction was moved.
- Moved,
+ FingerMoved { id: Finger, position: Point },
/// A touch interaction was ended.
- Ended,
+ FingerLifted { id: Finger, position: Point },
/// A touch interaction was canceled.
- Canceled,
+ FingerLost { id: Finger, position: Point },
}
+
+/// A unique identifier representing a finger on a touch interaction.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
+pub struct Finger(pub u64);