From 1d9ee564577e4a0025a65c4b708ce5773ad79587 Mon Sep 17 00:00:00 2001 From: Piefayth Date: Tue, 24 Sep 2024 06:40:54 -0500 Subject: [PATCH] Fix horizontal scrolling in scroll example for macOS (#15407) # Objective Fixes #15401 ## Solution Changes the scroll inversion hotkey in the example from Shift to Control. Shift is idiomatic for this. Since we cannot use Shift per #15401, I picked another modifier arbitrarily. A production app would handle this in a platform specific way until the platform behaviors are unified upstream, but no point here. ## Testing I don't have a mac readily available for testing, if someone wouldn't mind testing. I would also appreciate confirmation that trackpad is working nicely. --- examples/ui/scroll.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/ui/scroll.rs b/examples/ui/scroll.rs index 135ae688c9..4568111d83 100644 --- a/examples/ui/scroll.rs +++ b/examples/ui/scroll.rs @@ -56,7 +56,7 @@ fn setup(mut commands: Commands, asset_server: Res) { // header parent.spawn(( TextBundle::from_section( - "Horizontally Scrolling list (Shift + Mousewheel)", + "Horizontally Scrolling list (Ctrl + Mousewheel)", TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), font_size: FONT_SIZE, @@ -391,7 +391,8 @@ pub fn update_scroll_position( MouseScrollUnit::Pixel => (mouse_wheel_event.x, mouse_wheel_event.y), }; - if keyboard_input.pressed(KeyCode::ShiftLeft) || keyboard_input.pressed(KeyCode::ShiftRight) + if keyboard_input.pressed(KeyCode::ControlLeft) + || keyboard_input.pressed(KeyCode::ControlRight) { std::mem::swap(&mut dx, &mut dy); }