diff options
author | Joe Wilm <joe@jwilm.com> | 2016-12-11 20:00:00 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-12-11 20:23:41 -0800 |
commit | 3d26d3c68ac28aade9377109f897c85b147ddfa6 (patch) | |
tree | 3de603ba79fcef04a48c173d604593262d17130e | |
parent | 4df29bb37700ee9f2b8e09374c6db513daae89b3 (diff) | |
download | alacritty-3d26d3c68ac28aade9377109f897c85b147ddfa6.tar.gz alacritty-3d26d3c68ac28aade9377109f897c85b147ddfa6.zip |
Implement mouse scrolling with line deltas
This makes scrolling work for mouse wheels (was previously just
trackpads).
-rw-r--r-- | src/input.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/input.rs b/src/input.rs index 796e0fb5..994b2f1b 100644 --- a/src/input.rs +++ b/src/input.rs @@ -305,8 +305,16 @@ impl Processor { terminal: &Term ) { match delta { - MouseScrollDelta::LineDelta(_columns, _lines) => { - unimplemented!(); + MouseScrollDelta::LineDelta(_columns, lines) => { + let code = if lines > 0.0 { + 64 + } else { + 65 + }; + + for _ in 0..(lines.abs() as usize) { + self.mouse_report(code, notifier, terminal); + } }, MouseScrollDelta::PixelDelta(_x, y) => { match phase { |