summaryrefslogtreecommitdiffstats
path: root/core/src/touch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/touch.rs')
-rw-r--r--core/src/touch.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/src/touch.rs b/core/src/touch.rs
new file mode 100644
index 00000000..18120644
--- /dev/null
+++ b/core/src/touch.rs
@@ -0,0 +1,23 @@
+//! Build touch events.
+use crate::Point;
+
+/// A touch interaction.
+#[derive(Debug, Clone, Copy, PartialEq)]
+#[allow(missing_docs)]
+pub enum Event {
+ /// A touch interaction was started.
+ FingerPressed { id: Finger, position: Point },
+
+ /// An on-going touch interaction was moved.
+ FingerMoved { id: Finger, position: Point },
+
+ /// A touch interaction was ended.
+ FingerLifted { id: Finger, position: Point },
+
+ /// A touch interaction was 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);