1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:52:54 +08:00

Fix overbearing key down handling

This commit is contained in:
Dean Herbert 2023-04-08 22:18:29 +09:00
parent a1fc4def1d
commit 8d2e852ffd

View File

@ -81,25 +81,22 @@ namespace osu.Game.Screens.Edit.Compose.Components
protected override bool OnKeyDown(KeyDownEvent e)
{
base.OnKeyDown(e);
if (cumulativeRotation.Value != null && (e.Key == Key.ShiftLeft || e.Key == Key.ShiftRight))
if (IsDragged && (e.Key == Key.ShiftLeft || e.Key == Key.ShiftRight))
{
applyRotation(shouldSnap: true);
return true;
}
return true;
return base.OnKeyDown(e);
}
protected override void OnKeyUp(KeyUpEvent e)
{
base.OnKeyUp(e);
if (cumulativeRotation.Value != null && (e.Key == Key.ShiftLeft || e.Key == Key.ShiftRight))
{
if (IsDragged && (e.Key == Key.ShiftLeft || e.Key == Key.ShiftRight))
applyRotation(shouldSnap: false);
}
}
protected override void OnDragEnd(DragEndEvent e)
{