diff options
author | Josh Rahm <rahm@google.com> | 2025-02-06 12:20:33 -0700 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2025-02-06 12:20:33 -0700 |
commit | e87f73cf3c8865d97263d578d8b108b1fe3ef4fb (patch) | |
tree | 30e704e9498e29ad8b224e26d3950570ac3434e6 | |
parent | d59bb36ae7e9e55a7d721655590f4a79988651c3 (diff) | |
download | r-alacritty-e87f73cf3c8865d97263d578d8b108b1fe3ef4fb.tar.gz r-alacritty-e87f73cf3c8865d97263d578d8b108b1fe3ef4fb.tar.bz2 r-alacritty-e87f73cf3c8865d97263d578d8b108b1fe3ef4fb.zip |
Have alacritty pass through X1Mouse and X2Mouse to Vim. (Forward and Backward buttons)
-rw-r--r-- | alacritty/src/input/mod.rs | 9 |
1 files 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<T: EventListener, A: ActionContext<T>> Processor<T, A> { } // 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<T: EventListener, A: ActionContext<T>> Processor<T, A> { 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(); |