1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Fix playback controls in editor handling key repeat when they probably shouldn't

Closes https://github.com/ppy/osu/issues/23903.
This commit is contained in:
Dean Herbert 2023-06-14 02:29:56 +09:00
parent bda1940891
commit f553efba8a
2 changed files with 15 additions and 0 deletions

View File

@ -76,6 +76,9 @@ namespace osu.Game.Screens.Edit.Components
protected override bool OnKeyDown(KeyDownEvent e)
{
if (e.Repeat)
return false;
switch (e.Key)
{
case Key.Space:

View File

@ -533,6 +533,9 @@ namespace osu.Game.Screens.Edit
// Track traversal keys.
// Matching osu-stable implementations.
case Key.Z:
if (e.Repeat)
return false;
// Seek to first object time, or track start if already there.
double? firstObjectTime = editorBeatmap.HitObjects.FirstOrDefault()?.StartTime;
@ -543,12 +546,18 @@ namespace osu.Game.Screens.Edit
return true;
case Key.X:
if (e.Repeat)
return false;
// Restart playback from beginning of track.
clock.Seek(0);
clock.Start();
return true;
case Key.C:
if (e.Repeat)
return false;
// Pause or resume.
if (clock.IsRunning)
clock.Stop();
@ -557,6 +566,9 @@ namespace osu.Game.Screens.Edit
return true;
case Key.V:
if (e.Repeat)
return false;
// Seek to last object time, or track end if already there.
// Note that in osu-stable subsequent presses when at track end won't return to last object.
// This has intentionally been changed to make it more useful.