aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Input
diff options
context:
space:
mode:
authorTSRBerry <20988865+TSRBerry@users.noreply.github.com>2024-05-17 21:58:03 +0200
committerGitHub <noreply@github.com>2024-05-17 16:58:03 -0300
commit8f51938e2b22ee438ce8f849cc9258026ec5da29 (patch)
tree6fb3f1bebb63000de9290489521794dec4fa1de9 /src/Ryujinx.Input
parent4d84df94873a070f6f5c199438f957b24d8cf8a9 (diff)
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
Diffstat (limited to 'src/Ryujinx.Input')
-rw-r--r--src/Ryujinx.Input/HLE/NpadManager.cs5
-rw-r--r--src/Ryujinx.Input/IGamepadDriver.cs6
2 files changed, 11 insertions, 0 deletions
diff --git a/src/Ryujinx.Input/HLE/NpadManager.cs b/src/Ryujinx.Input/HLE/NpadManager.cs
index 4c7bb8b7..1bc54d69 100644
--- a/src/Ryujinx.Input/HLE/NpadManager.cs
+++ b/src/Ryujinx.Input/HLE/NpadManager.cs
@@ -174,6 +174,11 @@ 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 67b01c26..625c3e69 100644
--- a/src/Ryujinx.Input/IGamepadDriver.cs
+++ b/src/Ryujinx.Input/IGamepadDriver.cs
@@ -33,5 +33,11 @@ namespace Ryujinx.Input
/// <param name="id">The unique id of the gamepad</param>
/// <returns>An instance of <see cref="IGamepad"/> associated to the gamepad id given or null if not found</returns>
IGamepad GetGamepad(string id);
+
+ /// <summary>
+ /// Clear the internal state of the driver.
+ /// </summary>
+ /// <remarks>Does nothing by default.</remarks>
+ void Clear() { }
}
}