Ignore shift-delete in SearchTextBox

This commit is contained in:
David Zhao 2019-07-16 14:55:41 +09:00
parent 60adac23b4
commit e789bb37c8

View File

@ -3,6 +3,7 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osuTK; using osuTK;
using osuTK.Input; using osuTK.Input;
@ -15,6 +16,8 @@ namespace osu.Game.Graphics.UserInterface
public override bool HandleLeftRightArrows => false; public override bool HandleLeftRightArrows => false;
private InputManager inputManager;
public SearchTextBox() public SearchTextBox()
{ {
Height = 35; Height = 35;
@ -33,6 +36,21 @@ namespace osu.Game.Graphics.UserInterface
PlaceholderText = "type to search"; PlaceholderText = "type to search";
} }
protected override void LoadComplete()
{
inputManager = GetContainingInputManager();
base.LoadComplete();
}
protected override bool HandleAction(PlatformAction action)
{
// Allow shift-delete to be handled locally
if (inputManager.CurrentState.Keyboard.ShiftPressed && action.ActionType == PlatformActionType.CharNext && action.ActionMethod == PlatformActionMethod.Delete)
return false;
return base.HandleAction(action);
}
protected override bool OnKeyDown(KeyDownEvent e) protected override bool OnKeyDown(KeyDownEvent e)
{ {
if (!e.ControlPressed && !e.ShiftPressed) if (!e.ControlPressed && !e.ShiftPressed)