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:
Joseph Madamba
2023-01-10 14:05:08 -08:00
parent c2dd822e4a
commit 776b60f3b3
2 changed files with 17 additions and 5 deletions

View File

@ -5,6 +5,7 @@
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
@ -14,6 +15,7 @@ using osu.Framework.Input.Events;
using osu.Game.Input.Bindings;
using osu.Game.Overlays;
using osuTK;
using osuTK.Input;
namespace osu.Game.Graphics.UserInterfaceV2
{
@ -58,6 +60,14 @@ namespace osu.Game.Graphics.UserInterfaceV2
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)
{
if (e.Repeat)
@ -68,7 +78,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
if (e.Action == GlobalAction.Back)
{
Hide();
this.HidePopover();
return true;
}