From 8e50dd9fa6f1069dd7c5efca72afb487eeb33a54 Mon Sep 17 00:00:00 2001 From: madwind Date: Sun, 29 Dec 2024 01:49:25 +0800 Subject: [PATCH] fix right JoyCon stick --- src/Ryujinx.Input.SDL2/SDL2JoyCon.cs | 30 +++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/Ryujinx.Input.SDL2/SDL2JoyCon.cs b/src/Ryujinx.Input.SDL2/SDL2JoyCon.cs index f7e0ccbf9..b25243932 100644 --- a/src/Ryujinx.Input.SDL2/SDL2JoyCon.cs +++ b/src/Ryujinx.Input.SDL2/SDL2JoyCon.cs @@ -67,23 +67,21 @@ namespace Ryujinx.Input.SDL2 public (float, float) GetStick(StickInputId inputId) { - if (inputId == StickInputId.Left) + switch (inputId) { - switch (_joyConType) - { - case JoyConType.Left: - { - (float x, float y) = _gamepad.GetStick(inputId); - return (y, -x); - } - case JoyConType.Right: - { - (float x, float y) = _gamepad.GetStick(inputId); - return (-y, x); - } - } - } - return (0, 0); + case StickInputId.Left when _joyConType == JoyConType.Left: + { + (float x, float y) = _gamepad.GetStick(inputId); + return (y, -x); + } + case StickInputId.Right when _joyConType == JoyConType.Right: + { + (float x, float y) = _gamepad.GetStick(StickInputId.Left); + return (-y, x); + } + default: + return (0, 0); + } } public GamepadFeaturesFlag Features => _gamepad.Features;