From acc89a5d2ef87d8cde541bfb0dc251830820e9c7 Mon Sep 17 00:00:00 2001 From: John Clemis Date: Tue, 17 Jul 2018 20:11:28 -0500 Subject: [PATCH] Address Feedback --- Ryujinx/Ui/GLScreen.cs | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/Ryujinx/Ui/GLScreen.cs b/Ryujinx/Ui/GLScreen.cs index 856ff67352..6306c32c3b 100644 --- a/Ryujinx/Ui/GLScreen.cs +++ b/Ryujinx/Ui/GLScreen.cs @@ -186,29 +186,7 @@ namespace Ryujinx case "-JOYSTICKAXIS1": return -GamePad.ThumbSticks.Left.Y; case "-JOYSTICKAXIS2": return -GamePad.ThumbSticks.Right.X; case "-JOYSTICKAXIS3": return -GamePad.ThumbSticks.Right.Y; - default: throw new ArgumentException(); - } - } - - private bool IsGamePadActive(int Index) - { - return IsGamePadActive(GamePad.GetState(Index)); - } - - private bool IsGamePadActive(GamePadState GamePad) - { - if (GamePad.IsConnected) - { - return GamePad.Buttons.IsAnyButtonPressed - || (GamePad.Triggers.Left >= 0.8f || GamePad.Triggers.Right >= 0.8f) - || ((GamePad.ThumbSticks.Left.X >= 0.1f || GamePad.ThumbSticks.Left.X <= -0.1f) - || (GamePad.ThumbSticks.Left.Y >= 0.1f || GamePad.ThumbSticks.Left.Y <= -0.1f) - || (GamePad.ThumbSticks.Right.X >= 0.1f || GamePad.ThumbSticks.Right.X <= -0.1f) - || (GamePad.ThumbSticks.Right.Y >= 0.1f || GamePad.ThumbSticks.Right.Y <= -0.1f)); - } - else - { - return false; + default: throw new ArgumentException(nameof(Joystick)); } } @@ -224,7 +202,7 @@ namespace Ryujinx int RightJoystickDY = 0; //Keyboard Input - if (Keyboard.HasValue && !IsGamePadActive(Config.GamePadIndex)) + if (Keyboard.HasValue) { KeyboardState Keyboard = this.Keyboard.Value; @@ -264,7 +242,7 @@ namespace Ryujinx } //Controller Input - if (Config.GamePadEnable && !Keyboard.HasValue && IsGamePadActive(Config.GamePadIndex)) + if (Config.GamePadEnable) { GamePadState GamePad = OpenTK.Input.GamePad.GetState(Config.GamePadIndex); float AnalogStickDeadzone = Config.GamePadDeadzone;