From fa452bcce1adfe1a4ae3b2bfcd53731924469b1c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 Jan 2025 02:51:43 +0900 Subject: [PATCH] Fix right mouse not working at song select for some things --- osu.Game/Screens/Select/BeatmapCarousel.cs | 38 ++++++++++++---------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 7e3c26a1ba..8ccf304c63 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -1176,33 +1176,37 @@ namespace osu.Game.Screens.Select protected override bool IsDragging => base.IsDragging || absoluteScrolling; - public bool OnPressed(KeyBindingPressEvent e) + protected override bool OnMouseDown(MouseDownEvent e) { - switch (e.Action) + if (e.Button == MouseButton.Right) { - case GlobalAction.AbsoluteScrollSongList: - // The default binding for absolute scroll is right mouse button. - // To avoid conflicts with context menus, disallow absolute scroll completely if it looks like things will fall over. - if (e.CurrentState.Mouse.Buttons.Contains(MouseButton.Right) - && GetContainingInputManager()!.HoveredDrawables.OfType().Any()) - return false; + // The default binding for absolute scroll is right mouse button. + // To avoid conflicts with context menus, disallow absolute scroll completely if it looks like things will fall over. + if (e.CurrentState.Mouse.Buttons.Contains(MouseButton.Right) + && GetContainingInputManager()!.HoveredDrawables.OfType().Any()) + return false; - ScrollToAbsolutePosition(e.CurrentState.Mouse.Position); - absoluteScrolling = true; - return true; + ScrollToAbsolutePosition(e.CurrentState.Mouse.Position); + absoluteScrolling = true; + return true; } + return base.OnMouseDown(e); + } + + protected override void OnMouseUp(MouseUpEvent e) + { + absoluteScrolling = false; + base.OnMouseUp(e); + } + + public bool OnPressed(KeyBindingPressEvent e) + { return false; } public void OnReleased(KeyBindingReleaseEvent e) { - switch (e.Action) - { - case GlobalAction.AbsoluteScrollSongList: - absoluteScrolling = false; - break; - } } protected override bool OnMouseMove(MouseMoveEvent e)