mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 18:32:56 +08:00
Fix manual input manager test scenes not matching game input hierarchy
Fix popover using on key down Fix popover not expiring when using global action
This commit is contained in:
parent
c2dd822e4a
commit
776b60f3b3
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
@ -14,6 +15,7 @@ using osu.Framework.Input.Events;
|
|||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterfaceV2
|
namespace osu.Game.Graphics.UserInterfaceV2
|
||||||
{
|
{
|
||||||
@ -58,6 +60,14 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
this.FadeOut(fade_duration, Easing.OutQuint);
|
this.FadeOut(fade_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Escape)
|
||||||
|
return false; // disable the framework-level handling of escape key for conformity (we use GlobalAction.Back).
|
||||||
|
|
||||||
|
return base.OnKeyDown(e);
|
||||||
|
}
|
||||||
|
|
||||||
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||||
{
|
{
|
||||||
if (e.Repeat)
|
if (e.Repeat)
|
||||||
@ -68,7 +78,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
|
|
||||||
if (e.Action == GlobalAction.Back)
|
if (e.Action == GlobalAction.Back)
|
||||||
{
|
{
|
||||||
Hide();
|
this.HidePopover();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,21 +46,23 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
var mainContent = content = new Container { RelativeSizeAxes = Axes.Both };
|
var mainContent = content = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
|
var inputContainer = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
if (DisplayCursorForManualInput)
|
if (DisplayCursorForManualInput)
|
||||||
{
|
{
|
||||||
var cursorDisplay = new GlobalCursorDisplay { RelativeSizeAxes = Axes.Both };
|
var cursorDisplay = new GlobalCursorDisplay { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
cursorDisplay.Add(new OsuTooltipContainer(cursorDisplay.MenuCursor)
|
cursorDisplay.Add(content = new OsuTooltipContainer(cursorDisplay.MenuCursor)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = mainContent
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mainContent = cursorDisplay;
|
inputContainer.Add(cursorDisplay);
|
||||||
|
mainContent = inputContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CreateNestedActionContainer)
|
if (CreateNestedActionContainer)
|
||||||
mainContent = new GlobalActionContainer(null).WithChild(mainContent);
|
inputContainer.Add(new GlobalActionContainer(null));
|
||||||
|
|
||||||
base.Content.AddRange(new Drawable[]
|
base.Content.AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user