mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-03 10:16:26 +02:00
42 lines
971 B
C#
42 lines
971 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
using Avalonia.Interactivity;
|
|
using System;
|
|
|
|
namespace Ryujinx.Ava.UI.Helpers
|
|
{
|
|
public class OffscreenTextBox : TextBox
|
|
{
|
|
protected override Type StyleKeyOverride => typeof(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
|
|
});
|
|
}
|
|
}
|
|
}
|