diff options
author | Tuomas Siipola <siiptuo@kapsi.fi> | 2017-01-31 23:45:36 +0200 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2017-02-06 11:43:26 -0800 |
commit | 6cc6086eed692c8c0db2b93c716296a55438a394 (patch) | |
tree | 4ca21f42fbd7ab2382f9e1b9ddbe70f90630445c | |
parent | 12cd04fea2d49f712226b75922bc2c035729c201 (diff) |
Send mouse wheel commands only if they're supported
Fixes #48
-rw-r--r-- | src/input.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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 { |