summaryrefslogtreecommitdiffstats
path: root/native/src/touch.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-12-17 05:19:14 +0100
committerLibravatar GitHub <noreply@github.com>2020-12-17 05:19:14 +0100
commit89e604d1602251f1ec16521fd714d60807217df7 (patch)
tree64d2f7683e9b465b4e85d8e12a5f01f354654fe1 /native/src/touch.rs
parenta42b3c6998274e75fd10f5ff3cecbdb37b9e3895 (diff)
parent277ae74d6817ee6192b5f7a44de19dcbdf8d58f7 (diff)
downloadiced-89e604d1602251f1ec16521fd714d60807217df7.tar.gz
iced-89e604d1602251f1ec16521fd714d60807217df7.tar.bz2
iced-89e604d1602251f1ec16521fd714d60807217df7.zip
Merge pull request #57 from simlay/ios-support-wip
Touch support
Diffstat (limited to 'native/src/touch.rs')
-rw-r--r--native/src/touch.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/native/src/touch.rs b/native/src/touch.rs
new file mode 100644
index 00000000..18120644
--- /dev/null
+++ b/native/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);