mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Implement mouse scrolling with line deltas
This makes scrolling work for mouse wheels (was previously just trackpads).
This commit is contained in:
parent
4df29bb377
commit
3d26d3c68a
1 changed files with 10 additions and 2 deletions
12
src/input.rs
12
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 {
|
||||
|
|
Loading…
Reference in a new issue