Merge pull request #31282 from peppy/fix-volume-key-repeat

Fix volume adjust key repeat not working as expected
This commit is contained in:
Bartłomiej Dach 2024-12-30 08:49:35 +01:00 committed by GitHub
commit f18114d2fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1428,24 +1428,25 @@ namespace osu.Game
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
if (e.Repeat)
return false;
if (introScreen == null) return false;
switch (e.Action)
{
case GlobalAction.DecreaseVolume:
case GlobalAction.IncreaseVolume:
return volume.Adjust(e.Action);
}
// All actions below this point don't allow key repeat.
if (e.Repeat)
return false;
// Wait until we're loaded at least to the intro before allowing various interactions.
if (introScreen == null) return false;
switch (e.Action)
{
case GlobalAction.ToggleMute:
case GlobalAction.NextVolumeMeter:
case GlobalAction.PreviousVolumeMeter:
if (e.Repeat)
return true;
return volume.Adjust(e.Action);
case GlobalAction.ToggleFPSDisplay: