Send mouse wheel commands only if they're supported

Fixes #48
This commit is contained in:
Tuomas Siipola 2017-01-31 23:45:36 +02:00 committed by Joe Wilm
parent 12cd04fea2
commit 6cc6086eed
1 changed files with 5 additions and 0 deletions

View File

@ -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 {