From 937c065af7ae7ba33974ed4733fc2bfc420a950c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Feb 2017 15:14:15 +0900 Subject: [PATCH] Clear content of SearchTextBox on first escape keypress. --- osu.Game/Screens/Select/SearchTextBox.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Select/SearchTextBox.cs b/osu.Game/Screens/Select/SearchTextBox.cs index a583def51c..f1870cca29 100644 --- a/osu.Game/Screens/Select/SearchTextBox.cs +++ b/osu.Game/Screens/Select/SearchTextBox.cs @@ -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); }