mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +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:
commit
dc9c2103d2
@ -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:
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user