1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 20:23:00 +08:00

Fix keyboard and mouse input not properly getting blocked by GameplayMenuOverlay

This commit is contained in:
Dean Herbert 2017-12-21 13:58:24 +09:00
parent 504ba1d6bc
commit b6fd5b0f17
2 changed files with 22 additions and 18 deletions

View File

@ -5,11 +5,12 @@ using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Framework.Input.Bindings; using osu.Framework.Input.Bindings;
namespace osu.Game.Input.Bindings namespace osu.Game.Input.Bindings
{ {
public class GlobalKeyBindingInputManager : DatabasedKeyBindingInputManager<GlobalAction> public class GlobalKeyBindingInputManager : DatabasedKeyBindingInputManager<GlobalAction>, IHandleGlobalInput
{ {
private readonly Drawable handler; private readonly Drawable handler;

View File

@ -26,6 +26,8 @@ namespace osu.Game.Screens.Play
protected override bool BlockPassThroughKeyboard => true; protected override bool BlockPassThroughKeyboard => true;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
public Action OnRetry; public Action OnRetry;
public Action OnQuit; public Action OnQuit;
@ -197,6 +199,7 @@ namespace osu.Game.Screens.Play
} }
private int _selectionIndex = -1; private int _selectionIndex = -1;
private int selectionIndex private int selectionIndex
{ {
get { return _selectionIndex; } get { return _selectionIndex; }
@ -219,9 +222,8 @@ namespace osu.Game.Screens.Play
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{ {
if (args.Repeat) if (!args.Repeat)
return false; {
switch (args.Key) switch (args.Key)
{ {
case Key.Up: case Key.Up:
@ -237,8 +239,9 @@ namespace osu.Game.Screens.Play
selectionIndex++; selectionIndex++;
return true; return true;
} }
}
return false; return base.OnKeyDown(state, args);
} }
private void buttonSelectionChanged(DialogButton button, bool isSelected) private void buttonSelectionChanged(DialogButton button, bool isSelected)