mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-16 23:36:44 +00:00
Fix phantom configured Controllers (#3720)
Enable guest controller only when a valid host controller is mapped.
This commit is contained in:
parent
2df16ded9b
commit
49eadbc209
@ -51,7 +51,16 @@ namespace Ryujinx.Input.HLE
|
|||||||
{
|
{
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
_device.Hid.RefreshInputConfig(_inputConfig);
|
List<InputConfig> validInputs = new List<InputConfig>();
|
||||||
|
foreach (var inputConfigEntry in _inputConfig)
|
||||||
|
{
|
||||||
|
if (_controllers[(int)inputConfigEntry.PlayerIndex] != null)
|
||||||
|
{
|
||||||
|
validInputs.Add(inputConfigEntry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_device.Hid.RefreshInputConfig(validInputs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,6 +112,8 @@ namespace Ryujinx.Input.HLE
|
|||||||
_controllers[i] = null;
|
_controllers[i] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<InputConfig> validInputs = new List<InputConfig>();
|
||||||
|
|
||||||
foreach (InputConfig inputConfigEntry in inputConfig)
|
foreach (InputConfig inputConfigEntry in inputConfig)
|
||||||
{
|
{
|
||||||
NpadController controller = new NpadController(_cemuHookClient);
|
NpadController controller = new NpadController(_cemuHookClient);
|
||||||
@ -116,6 +127,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
_controllers[(int)inputConfigEntry.PlayerIndex] = controller;
|
_controllers[(int)inputConfigEntry.PlayerIndex] = controller;
|
||||||
|
validInputs.Add(inputConfigEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +135,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
_enableKeyboard = enableKeyboard;
|
_enableKeyboard = enableKeyboard;
|
||||||
_enableMouse = enableMouse;
|
_enableMouse = enableMouse;
|
||||||
|
|
||||||
_device.Hid.RefreshInputConfig(inputConfig);
|
_device.Hid.RefreshInputConfig(validInputs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user