1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Merge pull request #23904 from peppy/fix-editor-repeat

Fix playback controls in editor handling key repeat when they probably shouldn't
This commit is contained in:
Bartłomiej Dach 2023-06-13 22:03:07 +02:00 committed by GitHub
commit dc9c2103d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.