aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r--alacritty/src/event.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 2fb60b2a..9388b8a9 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -1033,7 +1033,7 @@ pub struct Mouse {
pub last_click_timestamp: Instant,
pub last_click_button: MouseButton,
pub click_state: ClickState,
- pub scroll_px: f64,
+ pub accumulated_scroll: AccumulatedScroll,
pub cell_side: Side,
pub lines_scrolled: f32,
pub block_hint_launcher: bool,
@@ -1057,7 +1057,7 @@ impl Default for Mouse {
block_hint_launcher: Default::default(),
inside_text_area: Default::default(),
lines_scrolled: Default::default(),
- scroll_px: Default::default(),
+ accumulated_scroll: Default::default(),
x: Default::default(),
y: Default::default(),
}
@@ -1081,6 +1081,16 @@ impl Mouse {
}
}
+/// The amount of scroll accumulated from the pointer events.
+#[derive(Default, Debug)]
+pub struct AccumulatedScroll {
+ /// Scroll we should perform along `x` axis.
+ pub x: f64,
+
+ /// Scroll we should perform along `y` axis.
+ pub y: f64,
+}
+
impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
/// Handle events from winit.
pub fn handle_event(&mut self, event: WinitEvent<'_, Event>) {