mirror of
https://github.com/ppy/osu
synced 2025-03-02 09:30:57 +00:00
Ignore shift-delete in SearchTextBox
This commit is contained in:
parent
60adac23b4
commit
e789bb37c8
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user