mirror of
https://github.com/bevyengine/bevy
synced 2024-11-24 21:53:07 +00:00
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.
This commit is contained in:
parent
b5eebb3e36
commit
1d9ee56457
1 changed files with 3 additions and 2 deletions
|
@ -56,7 +56,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
// header
|
// header
|
||||||
parent.spawn((
|
parent.spawn((
|
||||||
TextBundle::from_section(
|
TextBundle::from_section(
|
||||||
"Horizontally Scrolling list (Shift + Mousewheel)",
|
"Horizontally Scrolling list (Ctrl + Mousewheel)",
|
||||||
TextStyle {
|
TextStyle {
|
||||||
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
|
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
|
||||||
font_size: FONT_SIZE,
|
font_size: FONT_SIZE,
|
||||||
|
@ -391,7 +391,8 @@ pub fn update_scroll_position(
|
||||||
MouseScrollUnit::Pixel => (mouse_wheel_event.x, mouse_wheel_event.y),
|
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);
|
std::mem::swap(&mut dx, &mut dy);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue