diff options
Diffstat (limited to 'Ryujinx.Ava/Ui/Controls/OffscreenTextBox.cs')
-rw-r--r-- | Ryujinx.Ava/Ui/Controls/OffscreenTextBox.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Ryujinx.Ava/Ui/Controls/OffscreenTextBox.cs b/Ryujinx.Ava/Ui/Controls/OffscreenTextBox.cs new file mode 100644 index 00000000..ffe5bdde --- /dev/null +++ b/Ryujinx.Ava/Ui/Controls/OffscreenTextBox.cs @@ -0,0 +1,40 @@ +using Avalonia.Controls; +using Avalonia.Input; +using Avalonia.Interactivity; + +namespace Ryujinx.Ava.Ui.Controls +{ + public class OffscreenTextBox : TextBox + { + public RoutedEvent<KeyEventArgs> GetKeyDownRoutedEvent() + { + return KeyDownEvent; + } + + public 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, + Device = KeyboardDevice.Instance, + Source = this, + RoutedEvent = TextInputEvent + }); + } + } +}
\ No newline at end of file |