From bed516bfda2b558c894e80a0d71f457c6e94a62f Mon Sep 17 00:00:00 2001 From: darko1979 Date: Sat, 12 Mar 2022 18:23:48 +0100 Subject: Implement rotate stick 90 degrees clockwise (#3084) * Implement swapping sticks * Rotate 90 degrees clockwise Co-authored-by: matesic.darko@gmail.com --- Ryujinx.Input.SDL2/SDL2Gamepad.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Ryujinx.Input.SDL2') diff --git a/Ryujinx.Input.SDL2/SDL2Gamepad.cs b/Ryujinx.Input.SDL2/SDL2Gamepad.cs index 0ccd8bb3..eec4e07e 100644 --- a/Ryujinx.Input.SDL2/SDL2Gamepad.cs +++ b/Ryujinx.Input.SDL2/SDL2Gamepad.cs @@ -350,6 +350,14 @@ namespace Ryujinx.Input.SDL2 { resultY = -resultY; } + + if ((inputId == StickInputId.Left && _configuration.LeftJoyconStick.Rotate90CW) || + (inputId == StickInputId.Right && _configuration.RightJoyconStick.Rotate90CW)) + { + float temp = resultX; + resultX = resultY; + resultY = -temp; + } } return (resultX, resultY); -- cgit v1.2.3