From 1f492e99d8ab3df543729225fdc5550d3ed2f1c8 Mon Sep 17 00:00:00 2001 From: John Clemis Date: Wed, 27 Jun 2018 19:26:11 -0500 Subject: [PATCH] Fixed Joystick Axis Problems Fixed Joystick Axis Problems when switching around the Joysticks (Left Stick is Right and Right stick is Left) --- Ryujinx/Ui/GLScreen.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Ryujinx/Ui/GLScreen.cs b/Ryujinx/Ui/GLScreen.cs index 279e6e94c..50dfe7013 100644 --- a/Ryujinx/Ui/GLScreen.cs +++ b/Ryujinx/Ui/GLScreen.cs @@ -131,7 +131,7 @@ namespace Ryujinx result = gamePad.ThumbSticks.Left; break; case "RJoystick": - result = gamePad.ThumbSticks.Right; + result = new Vector2(-gamePad.ThumbSticks.Right.Y, -gamePad.ThumbSticks.Right.X); break; default: Console.Error.WriteLine("Invalid Joystick Axis \"" + str + "\"! Defaulting the Vector2 to 0, 0."); @@ -235,13 +235,14 @@ namespace Ryujinx >= 0.5) CurrentButton |= HidControllerButtons.KEY_ZL; //RightJoystick + if (getJoystickAxisFromString(gamePad, Config.Controls_Right_FakeJoycon_GamePadJoystick_R).X >= deadzone || getJoystickAxisFromString(gamePad, Config.Controls_Right_FakeJoycon_GamePadJoystick_R).X <= -deadzone) - RightJoystickDY = (int)(-getJoystickAxisFromString(gamePad, Config.Controls_Right_FakeJoycon_GamePadJoystick_R).X * short.MaxValue); + RightJoystickDX = (int)(getJoystickAxisFromString(gamePad, Config.Controls_Right_FakeJoycon_GamePadJoystick_R).X * short.MaxValue); if (getJoystickAxisFromString(gamePad, Config.Controls_Right_FakeJoycon_GamePadJoystick_R).Y >= deadzone || getJoystickAxisFromString(gamePad, Config.Controls_Right_FakeJoycon_GamePadJoystick_R).Y <= -deadzone) - RightJoystickDX = (int)(-getJoystickAxisFromString(gamePad, Config.Controls_Right_FakeJoycon_GamePadJoystick_R).Y * short.MaxValue); + RightJoystickDY = (int)(getJoystickAxisFromString(gamePad, Config.Controls_Right_FakeJoycon_GamePadJoystick_R).Y * short.MaxValue); //LeftJoystick if (getJoystickAxisFromString(gamePad, Config.Controls_Left_FakeJoycon_GamePadJoystick_L).X >= deadzone