Allow Shift + Scroll to Horizontally Scroll in X11 and Wayland (#13676)
Release Notes: - Allows shift + scroll horizontal scrolling on X11 and Wayland. [Screencast from 2024-06-29 17-17-59.webm](https://github.com/zed-industries/zed/assets/14155062/2cac77b9-ecc8-4ddb-b08d-b5d964c8dc84)
This commit is contained in:
parent
d450a1d9e6
commit
b1f8fc88a1
2 changed files with 21 additions and 1 deletions
|
@ -817,10 +817,15 @@ impl X11Client {
|
|||
|
||||
if let Some(old_scroll) = old_scroll {
|
||||
let delta_scroll = old_scroll - new_scroll;
|
||||
let (x, y) = if !modifiers.shift {
|
||||
(0.0, delta_scroll)
|
||||
} else {
|
||||
(delta_scroll, 0.0)
|
||||
};
|
||||
window.handle_input(PlatformInput::ScrollWheel(
|
||||
crate::ScrollWheelEvent {
|
||||
position,
|
||||
delta: ScrollDelta::Lines(Point::new(0.0, delta_scroll)),
|
||||
delta: ScrollDelta::Lines(Point::new(x, y)),
|
||||
modifiers,
|
||||
touch_phase: TouchPhase::default(),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue