From 6cc6086eed692c8c0db2b93c716296a55438a394 Mon Sep 17 00:00:00 2001 From: Tuomas Siipola Date: Tue, 31 Jan 2017 23:45:36 +0200 Subject: [PATCH] Send mouse wheel commands only if they're supported Fixes #48 --- src/input.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/input.rs b/src/input.rs index 92126387..e6dc3993 100644 --- a/src/input.rs +++ b/src/input.rs @@ -285,6 +285,11 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { } pub fn on_mouse_wheel(&mut self, delta: MouseScrollDelta, phase: TouchPhase) { + let modes = mode::MOUSE_REPORT_CLICK | mode::MOUSE_MOTION | mode::SGR_MOUSE; + if !self.ctx.terminal_mode().intersects(modes) { + return; + } + match delta { MouseScrollDelta::LineDelta(_columns, lines) => { let code = if lines > 0.0 {