diff options
| author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2024-05-14 17:14:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-14 17:14:39 +0200 |
| commit | a3dc295c5f867bddb56a38f3a848ceb61ff30d32 (patch) | |
| tree | 7e8b472d377f2ff49ec31e1d4b01d59548271807 /src/Ryujinx.Gtk3 | |
| parent | 2ef4f92b0793feb7073ed85b7f7dc08dca6f14e9 (diff) | |
Disable keyboard controller input while swkbd is open (foreground) (#6646)
* Block input updates while swkbd is open in foreground mode
* Flush internal driver state before unblocking input updates
* Rename Flush to Clear and remove unnecessary attribute
Diffstat (limited to 'src/Ryujinx.Gtk3')
| -rw-r--r-- | src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs | 5 | ||||
| -rw-r--r-- | src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs b/src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs index e502254b..bd71c793 100644 --- a/src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs +++ b/src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs @@ -81,6 +81,11 @@ namespace Ryujinx.Input.GTK3 return _pressedKeys.Contains(nativeKey); } + public void Clear() + { + _pressedKeys.Clear(); + } + public IGamepad GetGamepad(string id) { if (!_keyboardIdentifers[0].Equals(id)) diff --git a/src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs b/src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs index 1d918d21..b3f509a0 100644 --- a/src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs +++ b/src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs @@ -107,6 +107,8 @@ namespace Ryujinx.UI.Applet swkbdDialog.SetInputLengthValidation(args.StringLengthMin, args.StringLengthMax); swkbdDialog.SetInputValidation(args.KeyboardMode); + ((MainWindow)_parent).RendererWidget.NpadManager.BlockInputUpdates(); + if (swkbdDialog.Run() == (int)ResponseType.Ok) { inputText = swkbdDialog.InputEntry.Text; @@ -128,6 +130,7 @@ namespace Ryujinx.UI.Applet }); dialogCloseEvent.WaitOne(); + ((MainWindow)_parent).RendererWidget.NpadManager.UnblockInputUpdates(); userText = error ? null : inputText; |
