diff --git a/Source/Engine/UI/GUI/Common/TextBoxBase.cs b/Source/Engine/UI/GUI/Common/TextBoxBase.cs index 41d8b9b44..92ea513a6 100644 --- a/Source/Engine/UI/GUI/Common/TextBoxBase.cs +++ b/Source/Engine/UI/GUI/Common/TextBoxBase.cs @@ -129,6 +129,16 @@ namespace FlaxEngine.GUI /// public event Action TextBoxEditEnd; + /// + /// Event fired when a key is down. + /// + public event Action KeyDown; + + /// + /// Event fired when a key is up. + /// + public event Action KeyUp; + /// /// Gets or sets a value indicating whether this is a multiline text box control. /// @@ -1168,12 +1178,20 @@ namespace FlaxEngine.GUI return true; } + /// + public override void OnKeyUp(KeyboardKeys key) + { + base.OnKeyUp(key); + KeyUp?.Invoke(key); + } + /// public override bool OnKeyDown(KeyboardKeys key) { var window = Root; bool shiftDown = window.GetKey(KeyboardKeys.Shift); bool ctrDown = window.GetKey(KeyboardKeys.Control); + KeyDown?.Invoke(key); switch (key) {