mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-10-22 18:33:01 +00:00
AvaloniaKeyboardDriver: Swallow TextInput events to avoid bell (#4320)
This commit is contained in:
parent
e3d0ccf8d5
commit
32a1cd83fd
1 changed files with 8 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Input;
|
using Ryujinx.Input;
|
||||||
using System;
|
using System;
|
||||||
|
@ -30,6 +31,7 @@ namespace Ryujinx.Ava.Input
|
||||||
_control.KeyDown += OnKeyPress;
|
_control.KeyDown += OnKeyPress;
|
||||||
_control.KeyUp += OnKeyRelease;
|
_control.KeyUp += OnKeyRelease;
|
||||||
_control.TextInput += Control_TextInput;
|
_control.TextInput += Control_TextInput;
|
||||||
|
_control.AddHandler(InputElement.TextInputEvent, Control_LastChanceTextInput, RoutingStrategies.Bubble);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Control_TextInput(object sender, TextInputEventArgs e)
|
private void Control_TextInput(object sender, TextInputEventArgs e)
|
||||||
|
@ -37,6 +39,12 @@ namespace Ryujinx.Ava.Input
|
||||||
TextInput?.Invoke(this, e.Text);
|
TextInput?.Invoke(this, e.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Control_LastChanceTextInput(object sender, TextInputEventArgs e)
|
||||||
|
{
|
||||||
|
// Swallow event
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
public event Action<string> OnGamepadConnected
|
public event Action<string> OnGamepadConnected
|
||||||
{
|
{
|
||||||
add { }
|
add { }
|
||||||
|
|
Loading…
Reference in a new issue