mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Only clear text in FocusedTextBox
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Input;
|
||||
using System;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
@ -18,6 +19,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
public Action Exit;
|
||||
|
||||
private bool focus;
|
||||
|
||||
public bool HoldFocus
|
||||
{
|
||||
get { return focus; }
|
||||
@ -38,6 +40,20 @@ namespace osu.Game.Graphics.UserInterface
|
||||
BorderThickness = 0;
|
||||
}
|
||||
|
||||
public override bool OnPressed(GlobalAction action)
|
||||
{
|
||||
if (action == GlobalAction.Back)
|
||||
{
|
||||
if (Text.Length > 0)
|
||||
{
|
||||
Text = string.Empty;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return base.OnPressed(action);
|
||||
}
|
||||
|
||||
protected override void KillFocus()
|
||||
{
|
||||
base.KillFocus();
|
||||
|
Reference in New Issue
Block a user