diff options
| author | Josh Rahm <rahm@google.com> | 2025-02-06 12:20:33 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2025-11-12 11:49:18 -0700 |
| commit | 1a18c5a963575bcacbdc8783c9214484f8dbe80a (patch) | |
| tree | caed2fa6fe4a1e80f414ca64eaf08fbecef196e2 | |
| parent | 12d14bec5ff88d74ad4943a8f3bc2a9b7b9ca307 (diff) | |
| download | r-alacritty-1a18c5a963575bcacbdc8783c9214484f8dbe80a.tar.gz r-alacritty-1a18c5a963575bcacbdc8783c9214484f8dbe80a.tar.bz2 r-alacritty-1a18c5a963575bcacbdc8783c9214484f8dbe80a.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 00f63396..6bff1bd6 100644 --- a/alacritty/src/input/mod.rs +++ b/alacritty/src/input/mod.rs @@ -559,7 +559,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); @@ -621,11 +621,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(); |