mirror of https://github.com/ppy/osu
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.Sprites;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Events;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
@ -15,6 +16,8 @@ public class SearchTextBox : FocusedTextBox
|
|||
|
||||
public override bool HandleLeftRightArrows => false;
|
||||
|
||||
private InputManager inputManager;
|
||||
|
||||
public SearchTextBox()
|
||||
{
|
||||
Height = 35;
|
||||
|
@ -33,6 +36,21 @@ public SearchTextBox()
|
|||
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)
|
||||
{
|
||||
if (!e.ControlPressed && !e.ShiftPressed)
|
||||
|
|
Loading…
Reference in New Issue