Disable keyboard controller input while swkbd is open (foreground) (second attempt) (#6808)

* 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

* Clear the driver state only if the GamepadDriver isn't null
This commit is contained in:
TSRBerry 2024-05-17 21:58:03 +02:00 committed by GitHub
parent 4d84df9487
commit 8f51938e2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 23 additions and 2 deletions

View file

@ -195,7 +195,7 @@ namespace Ryujinx.Ava.Input
public void Clear()
{
_driver?.ResetKeys();
_driver?.Clear();
}
public void Dispose() { }

View file

@ -94,7 +94,7 @@ namespace Ryujinx.Ava.Input
return _pressedKeys.Contains(nativeKey);
}
public void ResetKeys()
public void Clear()
{
_pressedKeys.Clear();
}

View file

@ -122,6 +122,7 @@ 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)
@ -143,6 +144,7 @@ namespace Ryujinx.Ava.UI.Applet
});
dialogCloseEvent.WaitOne();
_parent.ViewModel.AppHost.NpadManager.UnblockInputUpdates();
userText = error ? null : inputText;