From a3dc295c5f867bddb56a38f3a848ceb61ff30d32 Mon Sep 17 00:00:00 2001
From: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
Date: Tue, 14 May 2024 17:14:39 +0200
Subject: 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
---
src/Ryujinx.Input/HLE/NpadManager.cs | 5 +++++
src/Ryujinx.Input/IGamepadDriver.cs | 6 ++++++
2 files changed, 11 insertions(+)
(limited to 'src/Ryujinx.Input')
diff --git a/src/Ryujinx.Input/HLE/NpadManager.cs b/src/Ryujinx.Input/HLE/NpadManager.cs
index 4c7bb8b7..2409ecf2 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..ff4d3699 100644
--- a/src/Ryujinx.Input/IGamepadDriver.cs
+++ b/src/Ryujinx.Input/IGamepadDriver.cs
@@ -33,5 +33,11 @@ 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() { }
}
}
--
cgit v1.2.3