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

Merge pull request #3787 from peppy/editor-space-bar

Toggle pause in editor with spacebar
This commit is contained in:
Dan Balasescu 2018-11-30 15:16:53 +09:00 committed by GitHub
commit 51543d034b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ using osu.Framework.Timing;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osuTK.Input;
namespace osu.Game.Screens.Edit.Components namespace osu.Game.Screens.Edit.Components
{ {
@ -63,6 +64,18 @@ namespace osu.Game.Screens.Edit.Components
tabs.Current.ValueChanged += newValue => Beatmap.Value.Track.Tempo.Value = newValue; tabs.Current.ValueChanged += newValue => Beatmap.Value.Track.Tempo.Value = newValue;
} }
protected override bool OnKeyDown(KeyDownEvent e)
{
switch (e.Key)
{
case Key.Space:
togglePause();
return true;
}
return base.OnKeyDown(e);
}
private void togglePause() private void togglePause()
{ {
if (adjustableClock.IsRunning) if (adjustableClock.IsRunning)