mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:33:21 +08:00
Don't consume keys when handling momentary snap toggles
This commit is contained in:
parent
bea136ce50
commit
966dd786ae
@ -236,8 +236,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
if (e.Repeat)
|
if (e.Repeat)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (handleToggleViaKey(e.Key))
|
handleToggleViaKey(e.Key);
|
||||||
return true;
|
|
||||||
|
|
||||||
return base.OnKeyDown(e);
|
return base.OnKeyDown(e);
|
||||||
}
|
}
|
||||||
@ -248,22 +247,20 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
base.OnKeyUp(e);
|
base.OnKeyUp(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool handleToggleViaKey(Key key)
|
private void handleToggleViaKey(Key key)
|
||||||
{
|
{
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case Key.ShiftLeft:
|
case Key.ShiftLeft:
|
||||||
case Key.ShiftRight:
|
case Key.ShiftRight:
|
||||||
rectangularGridSnapToggle.Value = rectangularGridSnapToggle.Value == TernaryState.False ? TernaryState.True : TernaryState.False;
|
rectangularGridSnapToggle.Value = rectangularGridSnapToggle.Value == TernaryState.False ? TernaryState.True : TernaryState.False;
|
||||||
return true;
|
break;
|
||||||
|
|
||||||
case Key.AltLeft:
|
case Key.AltLeft:
|
||||||
case Key.AltRight:
|
case Key.AltRight:
|
||||||
distanceSnapToggle.Value = distanceSnapToggle.Value == TernaryState.False ? TernaryState.True : TernaryState.False;
|
distanceSnapToggle.Value = distanceSnapToggle.Value == TernaryState.False ? TernaryState.True : TernaryState.False;
|
||||||
return true;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private DistanceSnapGrid createDistanceSnapGrid(IEnumerable<HitObject> selectedHitObjects)
|
private DistanceSnapGrid createDistanceSnapGrid(IEnumerable<HitObject> selectedHitObjects)
|
||||||
|
Loading…
Reference in New Issue
Block a user