Add a virtual controller to merge Joy-Cons. #434

Open
madwind wants to merge 34 commits from madwind/master into master
Showing only changes of commit 8e50dd9fa6 - Show all commits

View File

@ -67,24 +67,22 @@ namespace Ryujinx.Input.SDL2
public (float, float) GetStick(StickInputId inputId) public (float, float) GetStick(StickInputId inputId)
{ {
if (inputId == StickInputId.Left) switch (inputId)
{ {
switch (_joyConType) case StickInputId.Left when _joyConType == JoyConType.Left:
{
case JoyConType.Left:
{ {
(float x, float y) = _gamepad.GetStick(inputId); (float x, float y) = _gamepad.GetStick(inputId);
return (y, -x); return (y, -x);
} }
case JoyConType.Right: case StickInputId.Right when _joyConType == JoyConType.Right:
{ {
(float x, float y) = _gamepad.GetStick(inputId); (float x, float y) = _gamepad.GetStick(StickInputId.Left);
return (-y, x); return (-y, x);
} }
} default:
}
return (0, 0); return (0, 0);
} }
}
public GamepadFeaturesFlag Features => _gamepad.Features; public GamepadFeaturesFlag Features => _gamepad.Features;
public string Id => _gamepad.Id; public string Id => _gamepad.Id;