From cdccf89e103694dcad3833d900b7858a49dae1ec Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 15 May 2024 02:20:24 -0300 Subject: [PATCH] =?UTF-8?q?Revert=20"Disable=20keyboard=20controller=20inp?= =?UTF-8?q?ut=20while=20swkbd=20is=20open=20(foreground)=20(#=E2=80=A6"=20?= =?UTF-8?q?(#6805)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a3dc295c5f867bddb56a38f3a848ceb61ff30d32. --- src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs | 5 ----- src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs | 3 --- src/Ryujinx.Input/HLE/NpadManager.cs | 5 ----- src/Ryujinx.Input/IGamepadDriver.cs | 6 ------ src/Ryujinx/Input/AvaloniaKeyboard.cs | 2 +- src/Ryujinx/Input/AvaloniaKeyboardDriver.cs | 2 +- src/Ryujinx/UI/Applet/AvaHostUIHandler.cs | 2 -- 7 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs b/src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs index bd71c7933..e502254be 100644 --- a/src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs +++ b/src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs @@ -81,11 +81,6 @@ 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 b3f509a09..1d918d21b 100644 --- a/src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs +++ b/src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs @@ -107,8 +107,6 @@ 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; @@ -130,7 +128,6 @@ namespace Ryujinx.UI.Applet }); dialogCloseEvent.WaitOne(); - ((MainWindow)_parent).RendererWidget.NpadManager.UnblockInputUpdates(); userText = error ? null : inputText; diff --git a/src/Ryujinx.Input/HLE/NpadManager.cs b/src/Ryujinx.Input/HLE/NpadManager.cs index 2409ecf22..4c7bb8b7a 100644 --- a/src/Ryujinx.Input/HLE/NpadManager.cs +++ b/src/Ryujinx.Input/HLE/NpadManager.cs @@ -174,11 +174,6 @@ namespace Ryujinx.Input.HLE { lock (_lock) { - foreach (InputConfig inputConfig in _inputConfig) - { - _controllers[(int)inputConfig.PlayerIndex].GamepadDriver.Clear(); - } - _blockInputUpdates = false; } } diff --git a/src/Ryujinx.Input/IGamepadDriver.cs b/src/Ryujinx.Input/IGamepadDriver.cs index ff4d36993..67b01c26c 100644 --- a/src/Ryujinx.Input/IGamepadDriver.cs +++ b/src/Ryujinx.Input/IGamepadDriver.cs @@ -33,11 +33,5 @@ namespace Ryujinx.Input /// The unique id of the gamepad /// An instance of associated to the gamepad id given or null if not found IGamepad GetGamepad(string id); - - /// - /// Flush the internal state of the driver. - /// - /// Does nothing by default. - void Clear() { } } } diff --git a/src/Ryujinx/Input/AvaloniaKeyboard.cs b/src/Ryujinx/Input/AvaloniaKeyboard.cs index ff88de79e..fbaaaabab 100644 --- a/src/Ryujinx/Input/AvaloniaKeyboard.cs +++ b/src/Ryujinx/Input/AvaloniaKeyboard.cs @@ -195,7 +195,7 @@ namespace Ryujinx.Ava.Input public void Clear() { - _driver?.Clear(); + _driver?.ResetKeys(); } public void Dispose() { } diff --git a/src/Ryujinx/Input/AvaloniaKeyboardDriver.cs b/src/Ryujinx/Input/AvaloniaKeyboardDriver.cs index 9f87e821a..e9e71b99b 100644 --- a/src/Ryujinx/Input/AvaloniaKeyboardDriver.cs +++ b/src/Ryujinx/Input/AvaloniaKeyboardDriver.cs @@ -94,7 +94,7 @@ namespace Ryujinx.Ava.Input return _pressedKeys.Contains(nativeKey); } - public void Clear() + public void ResetKeys() { _pressedKeys.Clear(); } diff --git a/src/Ryujinx/UI/Applet/AvaHostUIHandler.cs b/src/Ryujinx/UI/Applet/AvaHostUIHandler.cs index 4bcf8eb94..4bcc35a7a 100644 --- a/src/Ryujinx/UI/Applet/AvaHostUIHandler.cs +++ b/src/Ryujinx/UI/Applet/AvaHostUIHandler.cs @@ -122,7 +122,6 @@ namespace Ryujinx.Ava.UI.Applet { try { - _parent.ViewModel.AppHost.NpadManager.BlockInputUpdates(); var response = await SwkbdAppletDialog.ShowInputDialog(LocaleManager.Instance[LocaleKeys.SoftwareKeyboard], args); if (response.Result == UserResult.Ok) @@ -144,7 +143,6 @@ namespace Ryujinx.Ava.UI.Applet }); dialogCloseEvent.WaitOne(); - _parent.ViewModel.AppHost.NpadManager.UnblockInputUpdates(); userText = error ? null : inputText;