summaryrefslogtreecommitdiffstats
path: root/native/src/input/touch.rs
diff options
context:
space:
mode:
authorLibravatar Sebastian Imlay <sebastian.imlay@gmail.com>2019-11-11 20:29:58 -0800
committerLibravatar Sebastian Imlay <sebastian.imlay@gmail.com>2020-03-18 11:26:53 -0700
commite19a07d40049f40f36d879a498fab4ce63778b27 (patch)
tree6ecdcb5345f6c00c2b53ee4d93afd8585c1dda2e /native/src/input/touch.rs
parent9da6ce474c2cd178ca5365d46760ba0882ce7121 (diff)
downloadiced-e19a07d40049f40f36d879a498fab4ce63778b27.tar.gz
iced-e19a07d40049f40f36d879a498fab4ce63778b27.tar.bz2
iced-e19a07d40049f40f36d879a498fab4ce63778b27.zip
Added initial touch events to support iOS
Diffstat (limited to 'native/src/input/touch.rs')
-rw-r--r--native/src/input/touch.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/native/src/input/touch.rs b/native/src/input/touch.rs
new file mode 100644
index 00000000..7c4a6210
--- /dev/null
+++ b/native/src/input/touch.rs
@@ -0,0 +1,39 @@
+//! Build touch events.
+/// The touch of a mobile device.
+#[derive(Debug, Clone, Copy, PartialEq)]
+pub enum Touch {
+ /// The touch cursor was started
+ Started {
+ /// The X coordinate of the touch position
+ x: f32,
+
+ /// The Y coordinate of the touch position
+ y: f32,
+ },
+ /// The touch cursor was ended
+ Ended {
+ /// The X coordinate of the touch position
+ x: f32,
+
+ /// The Y coordinate of the touch position
+ y: f32,
+ },
+
+ /// The touch was moved.
+ Moved {
+ /// The X coordinate of the touch position
+ x: f32,
+
+ /// The Y coordinate of the touch position
+ y: f32,
+ },
+
+ /// Some canceled button.
+ Cancelled {
+ /// The X coordinate of the touch position
+ x: f32,
+
+ /// The Y coordinate of the touch position
+ y: f32,
+ },
+}