From e87f73cf3c8865d97263d578d8b108b1fe3ef4fb Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 6 Feb 2025 12:20:33 -0700 Subject: Have alacritty pass through X1Mouse and X2Mouse to Vim. (Forward and Backward buttons) --- alacritty/src/input/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/alacritty/src/input/mod.rs b/alacritty/src/input/mod.rs index 3f85512f..113f1510 100644 --- a/alacritty/src/input/mod.rs +++ b/alacritty/src/input/mod.rs @@ -542,7 +542,7 @@ impl> Processor { } // Report mouse events. - if self.ctx.terminal().mode().contains(TermMode::SGR_MOUSE) { + if button > 2 || self.ctx.terminal().mode().contains(TermMode::SGR_MOUSE) { self.sgr_mouse_report(point, button + mods, state); } else if let ElementState::Released = state { self.normal_mouse_report(point, 3 + mods); @@ -604,11 +604,12 @@ impl> Processor { MouseButton::Left => 0, MouseButton::Middle => 1, MouseButton::Right => 2, - // Can't properly report more than three buttons.. - MouseButton::Back | MouseButton::Forward | MouseButton::Other(_) => return, + MouseButton::Back => 128, + MouseButton::Forward => 129, + MouseButton::Other(c) => c + 69, }; - self.mouse_report(code, ElementState::Pressed); + self.mouse_report(code.try_into().unwrap(), ElementState::Pressed); } else { // Calculate time since the last click to handle double/triple clicks. let now = Instant::now(); -- cgit