diff options
Diffstat (limited to 'src/Ryujinx/UI/Helpers/OffscreenTextBox.cs')
-rw-r--r-- | src/Ryujinx/UI/Helpers/OffscreenTextBox.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Ryujinx/UI/Helpers/OffscreenTextBox.cs b/src/Ryujinx/UI/Helpers/OffscreenTextBox.cs new file mode 100644 index 00000000..a055f335 --- /dev/null +++ b/src/Ryujinx/UI/Helpers/OffscreenTextBox.cs @@ -0,0 +1,39 @@ +using Avalonia.Controls; +using Avalonia.Input; +using Avalonia.Interactivity; + +namespace Ryujinx.Ava.UI.Helpers +{ + public class OffscreenTextBox : TextBox + { + public static RoutedEvent<KeyEventArgs> GetKeyDownRoutedEvent() + { + return KeyDownEvent; + } + + public static RoutedEvent<KeyEventArgs> GetKeyUpRoutedEvent() + { + return KeyUpEvent; + } + + public void SendKeyDownEvent(KeyEventArgs keyEvent) + { + OnKeyDown(keyEvent); + } + + public void SendKeyUpEvent(KeyEventArgs keyEvent) + { + OnKeyUp(keyEvent); + } + + public void SendText(string text) + { + OnTextInput(new TextInputEventArgs + { + Text = text, + Source = this, + RoutedEvent = TextInputEvent, + }); + } + } +} |