Allow pausing gameplay via middle mouse button

This commit is contained in:
Dean Herbert 2020-07-12 23:03:03 +09:00
parent 57cfdb82ce
commit 08696b9bca
2 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,7 @@ namespace osu.Game.Input.Bindings
new KeyBinding(new[] { InputKey.Control, InputKey.Tilde }, GlobalAction.QuickExit), new KeyBinding(new[] { InputKey.Control, InputKey.Tilde }, GlobalAction.QuickExit),
new KeyBinding(new[] { InputKey.Control, InputKey.Plus }, GlobalAction.IncreaseScrollSpeed), new KeyBinding(new[] { InputKey.Control, InputKey.Plus }, GlobalAction.IncreaseScrollSpeed),
new KeyBinding(new[] { InputKey.Control, InputKey.Minus }, GlobalAction.DecreaseScrollSpeed), new KeyBinding(new[] { InputKey.Control, InputKey.Minus }, GlobalAction.DecreaseScrollSpeed),
new KeyBinding(InputKey.MouseMiddle, GlobalAction.PauseGameplay),
}; };
public IEnumerable<KeyBinding> AudioControlKeyBindings => new[] public IEnumerable<KeyBinding> AudioControlKeyBindings => new[]
@ -157,5 +158,8 @@ namespace osu.Game.Input.Bindings
[Description("Home")] [Description("Home")]
Home, Home,
[Description("Pause")]
PauseGameplay,
} }
} }

View File

@ -251,6 +251,7 @@ namespace osu.Game.Screens.Play.HUD
switch (action) switch (action)
{ {
case GlobalAction.Back: case GlobalAction.Back:
case GlobalAction.PauseGameplay:
if (!pendingAnimation) if (!pendingAnimation)
BeginConfirm(); BeginConfirm();
return true; return true;