summaryrefslogtreecommitdiffstats
path: root/native/src/input/mouse
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-29 19:00:46 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-29 19:00:46 +0100
commitbd5d871eb6630bc8f987d72c771032f878fb91b6 (patch)
tree528784f51a84abb0863590864a4af8f854d462e2 /native/src/input/mouse
parent29588f604af66fb4911f791c0c402fccd30ba64b (diff)
downloadiced-bd5d871eb6630bc8f987d72c771032f878fb91b6.tar.gz
iced-bd5d871eb6630bc8f987d72c771032f878fb91b6.tar.bz2
iced-bd5d871eb6630bc8f987d72c771032f878fb91b6.zip
Handle touchpad scroll events
Diffstat (limited to 'native/src/input/mouse')
-rw-r--r--native/src/input/mouse/event.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/native/src/input/mouse/event.rs b/native/src/input/mouse/event.rs
index 7b68208f..478f9b4d 100644
--- a/native/src/input/mouse/event.rs
+++ b/native/src/input/mouse/event.rs
@@ -34,11 +34,22 @@ pub enum Event {
},
/// The mouse wheel was scrolled.
- WheelScrolled {
+ WheelScrolled { delta: ScrollDelta },
+}
+
+#[derive(Debug, Clone, Copy, PartialEq)]
+pub enum ScrollDelta {
+ Lines {
/// The number of horizontal lines scrolled
- delta_x: f32,
+ x: f32,
/// The number of vertical lines scrolled
- delta_y: f32,
+ y: f32,
+ },
+ Pixels {
+ /// The number of horizontal pixels scrolled
+ x: f32,
+ /// The number of vertical pixels scrolled
+ y: f32,
},
}