From 538fba826b75cdd2feffaeac684044246590cb29 Mon Sep 17 00:00:00 2001 From: Xpl0itR Date: Sun, 3 May 2020 03:00:53 +0100 Subject: Improvements to input and input configuration in the GUI. (#849) * Improvements to input and input configuration in the GUI * Requested changes * nits * more nits --- .../Configuration/ConfigurationFileFormat.cs | 13 +- Ryujinx.Common/Configuration/ConfigurationState.cs | 227 ++++++++++++--------- .../Configuration/Hid/ControllerConfig.cs | 30 +++ .../Configuration/Hid/ControllerInputId.cs | 3 +- Ryujinx.Common/Configuration/Hid/ControllerType.cs | 25 ++- Ryujinx.Common/Configuration/Hid/InputConfig.cs | 20 ++ Ryujinx.Common/Configuration/Hid/Key.cs | 3 +- Ryujinx.Common/Configuration/Hid/KeyboardConfig.cs | 20 ++ .../Configuration/Hid/KeyboardHotkeys.cs | 6 +- Ryujinx.Common/Configuration/Hid/NpadController.cs | 35 ---- .../Configuration/Hid/NpadControllerLeft.cs | 9 +- .../Configuration/Hid/NpadControllerRight.cs | 9 +- Ryujinx.Common/Configuration/Hid/NpadKeyboard.cs | 20 -- .../Configuration/Hid/NpadKeyboardLeft.cs | 8 +- .../Configuration/Hid/NpadKeyboardRight.cs | 8 +- Ryujinx.Common/Configuration/Hid/PlayerIndex.cs | 18 ++ 16 files changed, 277 insertions(+), 177 deletions(-) create mode 100644 Ryujinx.Common/Configuration/Hid/ControllerConfig.cs create mode 100644 Ryujinx.Common/Configuration/Hid/InputConfig.cs create mode 100644 Ryujinx.Common/Configuration/Hid/KeyboardConfig.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/NpadController.cs delete mode 100644 Ryujinx.Common/Configuration/Hid/NpadKeyboard.cs create mode 100644 Ryujinx.Common/Configuration/Hid/PlayerIndex.cs (limited to 'Ryujinx.Common/Configuration') diff --git a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs index ff5a67c4..09252b77 100644 --- a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs +++ b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs @@ -4,9 +4,7 @@ using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Logging; using Ryujinx.Common.Utilities; using Ryujinx.Configuration.System; -using Ryujinx.Configuration.Hid; using Ryujinx.Configuration.Ui; -using Ryujinx.UI.Input; namespace Ryujinx.Configuration { @@ -15,7 +13,7 @@ namespace Ryujinx.Configuration /// /// The current version of the file format /// - public const int CurrentVersion = 5; + public const int CurrentVersion = 6; public int Version { get; set; } @@ -129,11 +127,6 @@ namespace Ryujinx.Configuration /// public bool IgnoreMissingServices { get; set; } - /// - /// The primary controller's type - /// - public ControllerType ControllerType { get; set; } - /// /// Used to toggle columns in the GUI /// @@ -162,12 +155,12 @@ namespace Ryujinx.Configuration /// /// Keyboard control bindings /// - public NpadKeyboard KeyboardControls { get; set; } + public List KeyboardConfig { get; set; } /// /// Controller control bindings /// - public NpadController JoystickControls { get; set; } + public List ControllerConfig { get; set; } /// /// Loads a configuration file from disk diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs index d2826d36..a994e6d5 100644 --- a/Ryujinx.Common/Configuration/ConfigurationState.cs +++ b/Ryujinx.Common/Configuration/ConfigurationState.cs @@ -1,10 +1,9 @@ -using Ryujinx.Common; +using Ryujinx.Common; using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Logging; using Ryujinx.Configuration.Hid; using Ryujinx.Configuration.System; using Ryujinx.Configuration.Ui; -using Ryujinx.UI.Input; using System; using System.Collections.Generic; @@ -159,7 +158,7 @@ namespace Ryujinx.Configuration public ReactiveObject TimeZone { get; private set; } /// - /// System Time Offset in seconds + /// System Time Offset in Seconds /// public ReactiveObject SystemTimeOffset { get; private set; } @@ -207,32 +206,22 @@ namespace Ryujinx.Configuration /// public class HidSection { - /// - /// The primary controller's type - /// - public ReactiveObject ControllerType { get; private set; } - /// /// Enable or disable keyboard support (Independent from controllers binding) /// public ReactiveObject EnableKeyboard { get; private set; } /// - /// Keyboard control bindings + /// Input device configuration. + /// NOTE: This ReactiveObject won't issue an event when the List has elements added or removed. + /// TODO: Implement a ReactiveList class. /// - public ReactiveObject KeyboardControls { get; private set; } - - /// - /// Controller control bindings - /// - public ReactiveObject JoystickControls { get; private set; } + public ReactiveObject> InputConfig { get; private set; } public HidSection() { - ControllerType = new ReactiveObject(); - EnableKeyboard = new ReactiveObject(); - KeyboardControls = new ReactiveObject(); - JoystickControls = new ReactiveObject(); + EnableKeyboard = new ReactiveObject(); + InputConfig = new ReactiveObject>(); } } @@ -311,6 +300,21 @@ namespace Ryujinx.Configuration public ConfigurationFileFormat ToFileFormat() { + List controllerConfigList = new List(); + List keyboardConfigList = new List(); + + foreach (InputConfig inputConfig in Hid.InputConfig.Value) + { + if (inputConfig is ControllerConfig controllerConfig) + { + controllerConfigList.Add(controllerConfig); + } + else if (inputConfig is KeyboardConfig keyboardConfig) + { + keyboardConfigList.Add(keyboardConfig); + } + } + ConfigurationFileFormat configurationFile = new ConfigurationFileFormat { Version = ConfigurationFileFormat.CurrentVersion, @@ -336,7 +340,6 @@ namespace Ryujinx.Configuration EnableFsIntegrityChecks = System.EnableFsIntegrityChecks, FsGlobalAccessLogMode = System.FsGlobalAccessLogMode, IgnoreMissingServices = System.IgnoreMissingServices, - ControllerType = Hid.ControllerType, GuiColumns = new GuiColumns() { FavColumn = Ui.GuiColumns.FavColumn, @@ -354,8 +357,8 @@ namespace Ryujinx.Configuration EnableCustomTheme = Ui.EnableCustomTheme, CustomThemePath = Ui.CustomThemePath, EnableKeyboard = Hid.EnableKeyboard, - KeyboardControls = Hid.KeyboardControls, - JoystickControls = Hid.JoystickControls + KeyboardConfig = keyboardConfigList, + ControllerConfig = controllerConfigList }; return configurationFile; @@ -385,7 +388,6 @@ namespace Ryujinx.Configuration System.EnableFsIntegrityChecks.Value = true; System.FsGlobalAccessLogMode.Value = 0; System.IgnoreMissingServices.Value = false; - Hid.ControllerType.Value = ControllerType.Handheld; Ui.GuiColumns.FavColumn.Value = true; Ui.GuiColumns.IconColumn.Value = true; Ui.GuiColumns.AppColumn.Value = true; @@ -401,73 +403,51 @@ namespace Ryujinx.Configuration Ui.CustomThemePath.Value = ""; Hid.EnableKeyboard.Value = false; - Hid.KeyboardControls.Value = new NpadKeyboard + Hid.InputConfig.Value = new List { - LeftJoycon = new NpadKeyboardLeft - { - StickUp = Key.W, - StickDown = Key.S, - StickLeft = Key.A, - StickRight = Key.D, - StickButton = Key.F, - DPadUp = Key.Up, - DPadDown = Key.Down, - DPadLeft = Key.Left, - DPadRight = Key.Right, - ButtonMinus = Key.Minus, - ButtonL = Key.E, - ButtonZl = Key.Q, - }, - RightJoycon = new NpadKeyboardRight - { - StickUp = Key.I, - StickDown = Key.K, - StickLeft = Key.J, - StickRight = Key.L, - StickButton = Key.H, - ButtonA = Key.Z, - ButtonB = Key.X, - ButtonX = Key.C, - ButtonY = Key.V, - ButtonPlus = Key.Plus, - ButtonR = Key.U, - ButtonZr = Key.O, - }, - Hotkeys = new KeyboardHotkeys + new KeyboardConfig { - ToggleVsync = Key.Tab - } - }; - - Hid.JoystickControls.Value = new NpadController - { - Enabled = true, - Index = 0, - Deadzone = 0.05f, - TriggerThreshold = 0.5f, - LeftJoycon = new NpadControllerLeft - { - Stick = ControllerInputId.Axis0, - StickButton = ControllerInputId.Button8, - DPadUp = ControllerInputId.Hat0Up, - DPadDown = ControllerInputId.Hat0Down, - DPadLeft = ControllerInputId.Hat0Left, - DPadRight = ControllerInputId.Hat0Right, - ButtonMinus = ControllerInputId.Button6, - ButtonL = ControllerInputId.Button4, - ButtonZl = ControllerInputId.Axis2, - }, - RightJoycon = new NpadControllerRight - { - Stick = ControllerInputId.Axis3, - StickButton = ControllerInputId.Button9, - ButtonA = ControllerInputId.Button1, - ButtonB = ControllerInputId.Button0, - ButtonX = ControllerInputId.Button3, - ButtonY = ControllerInputId.Button2, - ButtonPlus = ControllerInputId.Button7, - ButtonR = ControllerInputId.Button5, - ButtonZr = ControllerInputId.Axis5, + Index = 0, + ControllerType = ControllerType.JoyconPair, + PlayerIndex = PlayerIndex.Player1, + LeftJoycon = new NpadKeyboardLeft + { + StickUp = Key.W, + StickDown = Key.S, + StickLeft = Key.A, + StickRight = Key.D, + StickButton = Key.F, + DPadUp = Key.Up, + DPadDown = Key.Down, + DPadLeft = Key.Left, + DPadRight = Key.Right, + ButtonMinus = Key.Minus, + ButtonL = Key.E, + ButtonZl = Key.Q, + ButtonSl = Key.Home, + ButtonSr = Key.End + }, + RightJoycon = new NpadKeyboardRight + { + StickUp = Key.I, + StickDown = Key.K, + StickLeft = Key.J, + StickRight = Key.L, + StickButton = Key.H, + ButtonA = Key.Z, + ButtonB = Key.X, + ButtonX = Key.C, + ButtonY = Key.V, + ButtonPlus = Key.Plus, + ButtonR = Key.U, + ButtonZr = Key.O, + ButtonSl = Key.PageUp, + ButtonSr = Key.PageDown + }, + Hotkeys = new KeyboardHotkeys + { + ToggleVsync = Key.Tab + } } }; } @@ -521,6 +501,71 @@ namespace Ryujinx.Configuration configurationFileUpdated = true; } + if (configurationFileFormat.Version < 6) + { + Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 6."); + + configurationFileFormat.ControllerConfig = new List(); + configurationFileFormat.KeyboardConfig = new List{ + new KeyboardConfig + { + Index = 0, + ControllerType = ControllerType.JoyconPair, + PlayerIndex = PlayerIndex.Player1, + LeftJoycon = new NpadKeyboardLeft + { + StickUp = Key.W, + StickDown = Key.S, + StickLeft = Key.A, + StickRight = Key.D, + StickButton = Key.F, + DPadUp = Key.Up, + DPadDown = Key.Down, + DPadLeft = Key.Left, + DPadRight = Key.Right, + ButtonMinus = Key.Minus, + ButtonL = Key.E, + ButtonZl = Key.Q, + ButtonSl = Key.Unbound, + ButtonSr = Key.Unbound + }, + RightJoycon = new NpadKeyboardRight + { + StickUp = Key.I, + StickDown = Key.K, + StickLeft = Key.J, + StickRight = Key.L, + StickButton = Key.H, + ButtonA = Key.Z, + ButtonB = Key.X, + ButtonX = Key.C, + ButtonY = Key.V, + ButtonPlus = Key.Plus, + ButtonR = Key.U, + ButtonZr = Key.O, + ButtonSl = Key.Unbound, + ButtonSr = Key.Unbound + }, + Hotkeys = new KeyboardHotkeys + { + ToggleVsync = Key.Tab + } + } + }; + + configurationFileUpdated = true; + } + + List inputConfig = new List(); + foreach (ControllerConfig controllerConfig in configurationFileFormat.ControllerConfig) + { + inputConfig.Add(controllerConfig); + } + foreach (KeyboardConfig keyboardConfig in configurationFileFormat.KeyboardConfig) + { + inputConfig.Add(keyboardConfig); + } + Graphics.MaxAnisotropy.Value = configurationFileFormat.MaxAnisotropy; Graphics.ShadersDumpPath.Value = configurationFileFormat.GraphicsShadersDumpPath; Logger.EnableDebug.Value = configurationFileFormat.LoggingEnableDebug; @@ -544,7 +589,6 @@ namespace Ryujinx.Configuration System.EnableFsIntegrityChecks.Value = configurationFileFormat.EnableFsIntegrityChecks; System.FsGlobalAccessLogMode.Value = configurationFileFormat.FsGlobalAccessLogMode; System.IgnoreMissingServices.Value = configurationFileFormat.IgnoreMissingServices; - Hid.ControllerType.Value = configurationFileFormat.ControllerType; Ui.GuiColumns.FavColumn.Value = configurationFileFormat.GuiColumns.FavColumn; Ui.GuiColumns.IconColumn.Value = configurationFileFormat.GuiColumns.IconColumn; Ui.GuiColumns.AppColumn.Value = configurationFileFormat.GuiColumns.AppColumn; @@ -559,14 +603,13 @@ namespace Ryujinx.Configuration Ui.EnableCustomTheme.Value = configurationFileFormat.EnableCustomTheme; Ui.CustomThemePath.Value = configurationFileFormat.CustomThemePath; Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard; - Hid.KeyboardControls.Value = configurationFileFormat.KeyboardControls; - Hid.JoystickControls.Value = configurationFileFormat.JoystickControls; + Hid.InputConfig.Value = inputConfig; if (configurationFileUpdated) { ToFileFormat().SaveConfig(configurationFilePath); - Common.Logging.Logger.PrintWarning(LogClass.Application, "Configuration file is updated!"); + Common.Logging.Logger.PrintWarning(LogClass.Application, "Configuration file has been updated!"); } } diff --git a/Ryujinx.Common/Configuration/Hid/ControllerConfig.cs b/Ryujinx.Common/Configuration/Hid/ControllerConfig.cs new file mode 100644 index 00000000..3e414055 --- /dev/null +++ b/Ryujinx.Common/Configuration/Hid/ControllerConfig.cs @@ -0,0 +1,30 @@ +namespace Ryujinx.Common.Configuration.Hid +{ + public class ControllerConfig : InputConfig + { + /// + /// Controller Left Analog Stick Deadzone + /// + public float DeadzoneLeft { get; set; } + + /// + /// Controller Right Analog Stick Deadzone + /// + public float DeadzoneRight { get; set; } + + /// + /// Controller Trigger Threshold + /// + public float TriggerThreshold { get; set; } + + /// + /// Left JoyCon Controller Bindings + /// + public NpadControllerLeft LeftJoycon { get; set; } + + /// + /// Right JoyCon Controller Bindings + /// + public NpadControllerRight RightJoycon { get; set; } + } +} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/ControllerInputId.cs b/Ryujinx.Common/Configuration/Hid/ControllerInputId.cs index 8969b6a4..606a1b0c 100644 --- a/Ryujinx.Common/Configuration/Hid/ControllerInputId.cs +++ b/Ryujinx.Common/Configuration/Hid/ControllerInputId.cs @@ -40,6 +40,7 @@ Hat2Up, Hat2Down, Hat2Left, - Hat2Right + Hat2Right, + Unbound } } diff --git a/Ryujinx.Common/Configuration/Hid/ControllerType.cs b/Ryujinx.Common/Configuration/Hid/ControllerType.cs index b0613b2d..0ad01bbb 100644 --- a/Ryujinx.Common/Configuration/Hid/ControllerType.cs +++ b/Ryujinx.Common/Configuration/Hid/ControllerType.cs @@ -1,11 +1,20 @@ -namespace Ryujinx.Configuration.Hid +using System; + +namespace Ryujinx.Common.Configuration.Hid { - public enum ControllerType + [Flags] + // This enum was duplicated from Ryujinx.HLE.HOS.Services.Hid.PlayerIndex and should be kept identical + public enum ControllerType : int { - ProController, - Handheld, - NpadPair, - NpadLeft, - NpadRight + None, + ProController = 1 << 0, + Handheld = 1 << 1, + JoyconPair = 1 << 2, + JoyconLeft = 1 << 3, + JoyconRight = 1 << 4, + Invalid = 1 << 5, + Pokeball = 1 << 6, + SystemExternal = 1 << 29, + System = 1 << 30 } -} +} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/InputConfig.cs b/Ryujinx.Common/Configuration/Hid/InputConfig.cs new file mode 100644 index 00000000..540506d5 --- /dev/null +++ b/Ryujinx.Common/Configuration/Hid/InputConfig.cs @@ -0,0 +1,20 @@ +namespace Ryujinx.Common.Configuration.Hid +{ + public class InputConfig + { + /// + /// Controller Device Index + /// + public int Index { get; set; } + + /// + /// Controller's Type + /// + public ControllerType ControllerType { get; set; } + + /// + /// Player's Index for the controller + /// + public PlayerIndex PlayerIndex { get; set; } + } +} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/Key.cs b/Ryujinx.Common/Configuration/Hid/Key.cs index b658396b..67177eec 100644 --- a/Ryujinx.Common/Configuration/Hid/Key.cs +++ b/Ryujinx.Common/Configuration/Hid/Key.cs @@ -148,6 +148,7 @@ Slash = 128, BackSlash = 129, NonUSBackSlash = 130, - LastKey = 131 + LastKey = 131, + Unbound } } diff --git a/Ryujinx.Common/Configuration/Hid/KeyboardConfig.cs b/Ryujinx.Common/Configuration/Hid/KeyboardConfig.cs new file mode 100644 index 00000000..664fdff0 --- /dev/null +++ b/Ryujinx.Common/Configuration/Hid/KeyboardConfig.cs @@ -0,0 +1,20 @@ +namespace Ryujinx.Common.Configuration.Hid +{ + public class KeyboardConfig : InputConfig + { + /// + /// Left JoyCon Keyboard Bindings + /// + public NpadKeyboardLeft LeftJoycon { get; set; } + + /// + /// Right JoyCon Keyboard Bindings + /// + public NpadKeyboardRight RightJoycon { get; set; } + + /// + /// Hotkey Keyboard Bindings + /// + public KeyboardHotkeys Hotkeys { get; set; } + } +} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/KeyboardHotkeys.cs b/Ryujinx.Common/Configuration/Hid/KeyboardHotkeys.cs index 30cc8d84..19cc0487 100644 --- a/Ryujinx.Common/Configuration/Hid/KeyboardHotkeys.cs +++ b/Ryujinx.Common/Configuration/Hid/KeyboardHotkeys.cs @@ -1,7 +1,9 @@ -namespace Ryujinx.Configuration.Hid +using Ryujinx.Configuration.Hid; + +namespace Ryujinx.Common.Configuration.Hid { public struct KeyboardHotkeys { public Key ToggleVsync { get; set; } } -} +} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/NpadController.cs b/Ryujinx.Common/Configuration/Hid/NpadController.cs deleted file mode 100644 index 94b985d5..00000000 --- a/Ryujinx.Common/Configuration/Hid/NpadController.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace Ryujinx.Common.Configuration.Hid -{ - public class NpadController - { - /// - /// Enables or disables controller support - /// - public bool Enabled { get; set; } - - /// - /// Controller Device Index - /// - public int Index { get; set; } - - /// - /// Controller Analog Stick Deadzone - /// - public float Deadzone { get; set; } - - /// - /// Controller Trigger Threshold - /// - public float TriggerThreshold { get; set; } - - /// - /// Left JoyCon Controller Bindings - /// - public NpadControllerLeft LeftJoycon { get; set; } - - /// - /// Right JoyCon Controller Bindings - /// - public NpadControllerRight RightJoycon { get; set; } - } -} diff --git a/Ryujinx.Common/Configuration/Hid/NpadControllerLeft.cs b/Ryujinx.Common/Configuration/Hid/NpadControllerLeft.cs index c221b5e8..00816e56 100644 --- a/Ryujinx.Common/Configuration/Hid/NpadControllerLeft.cs +++ b/Ryujinx.Common/Configuration/Hid/NpadControllerLeft.cs @@ -2,14 +2,19 @@ { public struct NpadControllerLeft { - public ControllerInputId Stick { get; set; } + public ControllerInputId StickX { get; set; } + public bool InvertStickX { get; set; } + public ControllerInputId StickY { get; set; } + public bool InvertStickY { get; set; } public ControllerInputId StickButton { get; set; } public ControllerInputId ButtonMinus { get; set; } public ControllerInputId ButtonL { get; set; } public ControllerInputId ButtonZl { get; set; } + public ControllerInputId ButtonSl { get; set; } + public ControllerInputId ButtonSr { get; set; } public ControllerInputId DPadUp { get; set; } public ControllerInputId DPadDown { get; set; } public ControllerInputId DPadLeft { get; set; } public ControllerInputId DPadRight { get; set; } } -} +} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/NpadControllerRight.cs b/Ryujinx.Common/Configuration/Hid/NpadControllerRight.cs index f52f6f16..b7b289cc 100644 --- a/Ryujinx.Common/Configuration/Hid/NpadControllerRight.cs +++ b/Ryujinx.Common/Configuration/Hid/NpadControllerRight.cs @@ -2,7 +2,10 @@ { public struct NpadControllerRight { - public ControllerInputId Stick { get; set; } + public ControllerInputId StickX { get; set; } + public bool InvertStickX { get; set; } + public ControllerInputId StickY { get; set; } + public bool InvertStickY { get; set; } public ControllerInputId StickButton { get; set; } public ControllerInputId ButtonA { get; set; } public ControllerInputId ButtonB { get; set; } @@ -11,5 +14,7 @@ public ControllerInputId ButtonPlus { get; set; } public ControllerInputId ButtonR { get; set; } public ControllerInputId ButtonZr { get; set; } + public ControllerInputId ButtonSl { get; set; } + public ControllerInputId ButtonSr { get; set; } } -} +} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/NpadKeyboard.cs b/Ryujinx.Common/Configuration/Hid/NpadKeyboard.cs deleted file mode 100644 index 5ae82756..00000000 --- a/Ryujinx.Common/Configuration/Hid/NpadKeyboard.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Ryujinx.UI.Input -{ - public class NpadKeyboard - { - /// - /// Left JoyCon Keyboard Bindings - /// - public Configuration.Hid.NpadKeyboardLeft LeftJoycon { get; set; } - - /// - /// Right JoyCon Keyboard Bindings - /// - public Configuration.Hid.NpadKeyboardRight RightJoycon { get; set; } - - /// - /// Hotkey Keyboard Bindings - /// - public Configuration.Hid.KeyboardHotkeys Hotkeys { get; set; } - } -} diff --git a/Ryujinx.Common/Configuration/Hid/NpadKeyboardLeft.cs b/Ryujinx.Common/Configuration/Hid/NpadKeyboardLeft.cs index 4a61d932..6b78f5b6 100644 --- a/Ryujinx.Common/Configuration/Hid/NpadKeyboardLeft.cs +++ b/Ryujinx.Common/Configuration/Hid/NpadKeyboardLeft.cs @@ -1,4 +1,6 @@ -namespace Ryujinx.Configuration.Hid +using Ryujinx.Configuration.Hid; + +namespace Ryujinx.Common.Configuration.Hid { public struct NpadKeyboardLeft { @@ -14,5 +16,7 @@ public Key ButtonMinus { get; set; } public Key ButtonL { get; set; } public Key ButtonZl { get; set; } + public Key ButtonSl { get; set; } + public Key ButtonSr { get; set; } } -} +} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/NpadKeyboardRight.cs b/Ryujinx.Common/Configuration/Hid/NpadKeyboardRight.cs index 0677b573..e2109902 100644 --- a/Ryujinx.Common/Configuration/Hid/NpadKeyboardRight.cs +++ b/Ryujinx.Common/Configuration/Hid/NpadKeyboardRight.cs @@ -1,4 +1,6 @@ -namespace Ryujinx.Configuration.Hid +using Ryujinx.Configuration.Hid; + +namespace Ryujinx.Common.Configuration.Hid { public struct NpadKeyboardRight { @@ -14,5 +16,7 @@ public Key ButtonPlus { get; set; } public Key ButtonR { get; set; } public Key ButtonZr { get; set; } + public Key ButtonSl { get; set; } + public Key ButtonSr { get; set; } } -} +} \ No newline at end of file diff --git a/Ryujinx.Common/Configuration/Hid/PlayerIndex.cs b/Ryujinx.Common/Configuration/Hid/PlayerIndex.cs new file mode 100644 index 00000000..2e34cb96 --- /dev/null +++ b/Ryujinx.Common/Configuration/Hid/PlayerIndex.cs @@ -0,0 +1,18 @@ +namespace Ryujinx.Common.Configuration.Hid +{ + // This enum was duplicated from Ryujinx.HLE.HOS.Services.Hid.PlayerIndex and should be kept identical + public enum PlayerIndex : int + { + Player1 = 0, + Player2 = 1, + Player3 = 2, + Player4 = 3, + Player5 = 4, + Player6 = 5, + Player7 = 6, + Player8 = 7, + Handheld = 8, + Unknown = 9, + Auto = 10 // Shouldn't be used directly + } +} \ No newline at end of file -- cgit v1.2.3