Added an event to subscribe to in TextBoxBase that gets fired when a key is down.

This commit is contained in:
Chandler Cox
2022-10-24 14:00:56 -05:00
parent 91663f0202
commit 616379c54b

View File

@@ -129,6 +129,11 @@ namespace FlaxEngine.GUI
/// </summary>
public event Action<TextBoxBase> TextBoxEditEnd;
/// <summary>
/// Event fired when a key is down.
/// </summary>
public event Action<KeyboardKeys> KeyDown;
/// <summary>
/// Gets or sets a value indicating whether this is a multiline text box control.
/// </summary>
@@ -1174,6 +1179,7 @@ namespace FlaxEngine.GUI
var window = Root;
bool shiftDown = window.GetKey(KeyboardKeys.Shift);
bool ctrDown = window.GetKey(KeyboardKeys.Control);
KeyDown?.Invoke(key);
switch (key)
{