mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +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:
parent
bda1940891
commit
f553efba8a
@ -76,6 +76,9 @@ namespace osu.Game.Screens.Edit.Components
|
|||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
{
|
{
|
||||||
|
if (e.Repeat)
|
||||||
|
return false;
|
||||||
|
|
||||||
switch (e.Key)
|
switch (e.Key)
|
||||||
{
|
{
|
||||||
case Key.Space:
|
case Key.Space:
|
||||||
|
@ -533,6 +533,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
// Track traversal keys.
|
// Track traversal keys.
|
||||||
// Matching osu-stable implementations.
|
// Matching osu-stable implementations.
|
||||||
case Key.Z:
|
case Key.Z:
|
||||||
|
if (e.Repeat)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Seek to first object time, or track start if already there.
|
// Seek to first object time, or track start if already there.
|
||||||
double? firstObjectTime = editorBeatmap.HitObjects.FirstOrDefault()?.StartTime;
|
double? firstObjectTime = editorBeatmap.HitObjects.FirstOrDefault()?.StartTime;
|
||||||
|
|
||||||
@ -543,12 +546,18 @@ namespace osu.Game.Screens.Edit
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case Key.X:
|
case Key.X:
|
||||||
|
if (e.Repeat)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Restart playback from beginning of track.
|
// Restart playback from beginning of track.
|
||||||
clock.Seek(0);
|
clock.Seek(0);
|
||||||
clock.Start();
|
clock.Start();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case Key.C:
|
case Key.C:
|
||||||
|
if (e.Repeat)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Pause or resume.
|
// Pause or resume.
|
||||||
if (clock.IsRunning)
|
if (clock.IsRunning)
|
||||||
clock.Stop();
|
clock.Stop();
|
||||||
@ -557,6 +566,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case Key.V:
|
case Key.V:
|
||||||
|
if (e.Repeat)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Seek to last object time, or track end if already there.
|
// 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.
|
// 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.
|
// This has intentionally been changed to make it more useful.
|
||||||
|
Loading…
Reference in New Issue
Block a user