1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 22:42:57 +08:00

Clear content of SearchTextBox on first escape keypress.

This commit is contained in:
Dean Herbert 2017-02-08 15:14:15 +09:00
parent bbf8d1000b
commit 937c065af7
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -3,13 +3,10 @@
using System;
using System.Linq;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
@ -66,7 +63,12 @@ namespace osu.Game.Screens.Select
protected override void OnFocusLost(InputState state)
{
if (state.Keyboard.Keys.Any(key => key == Key.Escape))
Exit?.Invoke();
{
if (Text.Length > 0)
Text = string.Empty;
else
Exit?.Invoke();
}
base.OnFocusLost(state);
}