From e19a07d40049f40f36d879a498fab4ce63778b27 Mon Sep 17 00:00:00 2001 From: Sebastian Imlay Date: Mon, 11 Nov 2019 20:29:58 -0800 Subject: Added initial touch events to support iOS --- native/src/input/touch.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 native/src/input/touch.rs (limited to 'native/src/input/touch.rs') 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, + }, +} -- cgit