support new input binding in ui config
This commit is contained in:
parent
dd9ea4bba6
commit
e72bee5f42
3 changed files with 172 additions and 105 deletions
|
@ -1,8 +1,9 @@
|
|||
using Ryujinx.HLE;
|
||||
using Ryujinx.HLE.Input;
|
||||
using Ryujinx.Common.Input;
|
||||
using Ryujinx.HLE;
|
||||
using Ryujinx.HLE.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
@ -11,7 +12,13 @@ namespace Ryujinx
|
|||
{
|
||||
public static class Config
|
||||
{
|
||||
public static JoyCon FakeJoyCon { get; internal set; }
|
||||
public static JoyConKeyboard JoyConKeyboard { get; set; }
|
||||
public static JoyConController JoyConController { get; set; }
|
||||
|
||||
public static float GamePadDeadzone { get; private set; }
|
||||
public static bool GamePadEnable { get; private set; }
|
||||
public static int GamePadIndex { get; private set; }
|
||||
public static float GamePadTriggerThreshold { get; private set; }
|
||||
|
||||
public static string IniPath { get; set; }
|
||||
|
||||
|
@ -33,6 +40,11 @@ namespace Ryujinx
|
|||
Log.SetEnable(LogLevel.Warning, Convert.ToBoolean(Parser.GetValue("Logging_Enable_Warn")));
|
||||
Log.SetEnable(LogLevel.Error, Convert.ToBoolean(Parser.GetValue("Logging_Enable_Error")));
|
||||
|
||||
GamePadEnable = Convert.ToBoolean(Parser.GetValue("GamePad_Enable"));
|
||||
GamePadIndex = Convert.ToInt32 (Parser.GetValue("GamePad_Index"));
|
||||
GamePadDeadzone = (float)Convert.ToDouble (Parser.GetValue("GamePad_Deadzone"), CultureInfo.InvariantCulture);
|
||||
GamePadTriggerThreshold = (float)Convert.ToDouble (Parser.GetValue("GamePad_Trigger_Threshold"), CultureInfo.InvariantCulture);
|
||||
|
||||
string[] FilteredLogClasses = Parser.GetValue("Logging_Filtered_Classes").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
//When the classes are specified on the list, we only
|
||||
|
@ -61,38 +73,67 @@ namespace Ryujinx
|
|||
}
|
||||
}
|
||||
|
||||
FakeJoyCon = new JoyCon
|
||||
JoyConKeyboard = new JoyConKeyboard
|
||||
{
|
||||
Left = new JoyConLeft
|
||||
Left = new JoyConKeyboardLeft
|
||||
{
|
||||
StickUp = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_Stick_Up")),
|
||||
StickDown = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_Stick_Down")),
|
||||
StickLeft = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_Stick_Left")),
|
||||
StickRight = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_Stick_Right")),
|
||||
StickButton = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_Stick_Button")),
|
||||
DPadUp = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_DPad_Up")),
|
||||
DPadDown = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_DPad_Down")),
|
||||
DPadLeft = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_DPad_Left")),
|
||||
DPadRight = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_DPad_Right")),
|
||||
ButtonMinus = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_Button_Minus")),
|
||||
ButtonL = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_Button_L")),
|
||||
ButtonZL = Convert.ToInt16(Parser.GetValue("Controls_Left_FakeJoycon_Button_ZL"))
|
||||
StickUp = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_Stick_Up")),
|
||||
StickDown = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_Stick_Down")),
|
||||
StickLeft = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_Stick_Left")),
|
||||
StickRight = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_Stick_Right")),
|
||||
StickButton = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_Stick_Button")),
|
||||
DPadUp = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_DPad_Up")),
|
||||
DPadDown = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_DPad_Down")),
|
||||
DPadLeft = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_DPad_Left")),
|
||||
DPadRight = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_DPad_Right")),
|
||||
ButtonMinus = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_Button_Minus")),
|
||||
ButtonL = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_Button_L")),
|
||||
ButtonZL = Convert.ToInt16(Parser.GetValue("Controls_Left_JoyConKeyboard_Button_ZL"))
|
||||
},
|
||||
|
||||
Right = new JoyConRight
|
||||
Right = new JoyConKeyboardRight
|
||||
{
|
||||
StickUp = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Stick_Up")),
|
||||
StickDown = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Stick_Down")),
|
||||
StickLeft = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Stick_Left")),
|
||||
StickRight = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Stick_Right")),
|
||||
StickButton = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Stick_Button")),
|
||||
ButtonA = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Button_A")),
|
||||
ButtonB = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Button_B")),
|
||||
ButtonX = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Button_X")),
|
||||
ButtonY = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Button_Y")),
|
||||
ButtonPlus = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Button_Plus")),
|
||||
ButtonR = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Button_R")),
|
||||
ButtonZR = Convert.ToInt16(Parser.GetValue("Controls_Right_FakeJoycon_Button_ZR"))
|
||||
StickUp = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Stick_Up")),
|
||||
StickDown = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Stick_Down")),
|
||||
StickLeft = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Stick_Left")),
|
||||
StickRight = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Stick_Right")),
|
||||
StickButton = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Stick_Button")),
|
||||
ButtonA = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Button_A")),
|
||||
ButtonB = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Button_B")),
|
||||
ButtonX = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Button_X")),
|
||||
ButtonY = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Button_Y")),
|
||||
ButtonPlus = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Button_Plus")),
|
||||
ButtonR = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Button_R")),
|
||||
ButtonZR = Convert.ToInt16(Parser.GetValue("Controls_Right_JoyConKeyboard_Button_ZR"))
|
||||
}
|
||||
};
|
||||
|
||||
JoyConController = new JoyConController
|
||||
{
|
||||
Left = new JoyConControllerLeft
|
||||
{
|
||||
Stick = Parser.GetValue("Controls_Left_JoyConController_Stick"),
|
||||
StickButton = Parser.GetValue("Controls_Left_JoyConController_Stick_Button"),
|
||||
DPadUp = Parser.GetValue("Controls_Left_JoyConController_DPad_Up"),
|
||||
DPadDown = Parser.GetValue("Controls_Left_JoyConController_DPad_Down"),
|
||||
DPadLeft = Parser.GetValue("Controls_Left_JoyConController_DPad_Left"),
|
||||
DPadRight = Parser.GetValue("Controls_Left_JoyConController_DPad_Right"),
|
||||
ButtonMinus = Parser.GetValue("Controls_Left_JoyConController_Button_Minus"),
|
||||
ButtonL = Parser.GetValue("Controls_Left_JoyConController_Button_L"),
|
||||
ButtonZL = Parser.GetValue("Controls_Left_JoyConController_Button_ZL")
|
||||
},
|
||||
|
||||
Right = new JoyConControllerRight
|
||||
{
|
||||
Stick = Parser.GetValue("Controls_Right_JoyConController_Stick"),
|
||||
StickButton = Parser.GetValue("Controls_Right_JoyConController_Stick_Button"),
|
||||
ButtonA = Parser.GetValue("Controls_Right_JoyConController_Button_A"),
|
||||
ButtonB = Parser.GetValue("Controls_Right_JoyConController_Button_B"),
|
||||
ButtonX = Parser.GetValue("Controls_Right_JoyConController_Button_X"),
|
||||
ButtonY = Parser.GetValue("Controls_Right_JoyConController_Button_Y"),
|
||||
ButtonPlus = Parser.GetValue("Controls_Right_JoyConController_Button_Plus"),
|
||||
ButtonR = Parser.GetValue("Controls_Right_JoyConController_Button_R"),
|
||||
ButtonZR = Parser.GetValue("Controls_Right_JoyConController_Button_ZR")
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -138,31 +179,56 @@ namespace Ryujinx
|
|||
|
||||
Parser.SetValue("Logging_Filtered_Classes", string.Join(',', FilteredClasses));
|
||||
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_Stick_Up", FakeJoyCon.Left.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_Stick_Down", FakeJoyCon.Left.StickDown.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_Stick_Left", FakeJoyCon.Left.StickLeft.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_Stick_Right", FakeJoyCon.Left.StickRight.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_Stick_Button", FakeJoyCon.Left.StickButton.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_DPad_Up", FakeJoyCon.Left.DPadUp.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_DPad_Down", FakeJoyCon.Left.DPadDown.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_DPad_Left", FakeJoyCon.Left.DPadLeft.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_DPad_Right", FakeJoyCon.Left.DPadRight.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_Button_Minus", FakeJoyCon.Left.ButtonMinus.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_Button_L", FakeJoyCon.Left.ButtonL.ToString());
|
||||
Parser.SetValue("Controls_Left_FakeJoycon_Button_ZL", FakeJoyCon.Left.ButtonZL.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_Stick_Up", JoyConKeyboard.Left.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_Stick_Down", JoyConKeyboard.Left.StickDown.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_Stick_Left", JoyConKeyboard.Left.StickLeft.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_Stick_Right", JoyConKeyboard.Left.StickRight.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_Stick_Button", JoyConKeyboard.Left.StickButton.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_DPad_Up", JoyConKeyboard.Left.DPadUp.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_DPad_Down", JoyConKeyboard.Left.DPadDown.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_DPad_Left", JoyConKeyboard.Left.DPadLeft.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_DPad_Right", JoyConKeyboard.Left.DPadRight.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_Button_Minus", JoyConKeyboard.Left.ButtonMinus.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_Button_L", JoyConKeyboard.Left.ButtonL.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConKeyboard_Button_ZL", JoyConKeyboard.Left.ButtonZL.ToString());
|
||||
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Stick_Up", FakeJoyCon.Right.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Stick_Down", FakeJoyCon.Right.StickDown.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Stick_Left", FakeJoyCon.Right.StickLeft.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Stick_Right", FakeJoyCon.Right.StickRight.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Stick_Button", FakeJoyCon.Right.StickButton.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Button_A", FakeJoyCon.Right.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Button_B", FakeJoyCon.Right.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Button_X", FakeJoyCon.Right.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Button_Y", FakeJoyCon.Right.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Button_Plus", FakeJoyCon.Right.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Button_R", FakeJoyCon.Right.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Right_FakeJoycon_Button_ZR", FakeJoyCon.Right.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Stick_Up", JoyConKeyboard.Right.StickUp.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Stick_Down", JoyConKeyboard.Right.StickDown.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Stick_Left", JoyConKeyboard.Right.StickLeft.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Stick_Right", JoyConKeyboard.Right.StickRight.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Stick_Button", JoyConKeyboard.Right.StickButton.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Button_A", JoyConKeyboard.Right.ButtonA.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Button_B", JoyConKeyboard.Right.ButtonB.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Button_X", JoyConKeyboard.Right.ButtonX.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Button_Y", JoyConKeyboard.Right.ButtonY.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Button_Plus", JoyConKeyboard.Right.ButtonPlus.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Button_R", JoyConKeyboard.Right.ButtonR.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConKeyboard_Button_ZR", JoyConKeyboard.Right.ButtonZR.ToString());
|
||||
|
||||
Parser.SetValue("Controls_Left_JoyConController_Stick", JoyConController.Left.Stick.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConController_Stick_Button", JoyConController.Left.StickButton.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConController_DPad_Up", JoyConController.Left.DPadUp.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConController_DPad_Down", JoyConController.Left.DPadDown.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConController_DPad_Left", JoyConController.Left.DPadLeft.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConController_DPad_Right", JoyConController.Left.DPadRight.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConController_Button_Minus", JoyConController.Left.ButtonMinus.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConController_Button_L", JoyConController.Left.ButtonL.ToString());
|
||||
Parser.SetValue("Controls_Left_JoyConController_Button_ZL", JoyConController.Left.ButtonZL.ToString());
|
||||
|
||||
Parser.SetValue("Controls_Right_JoyConController_Stick_Up", JoyConController.Right.Stick.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConController_Stick_Button", JoyConController.Right.StickButton.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConController_Button_A", JoyConController.Right.ButtonA.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConController_Button_B", JoyConController.Right.ButtonB.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConController_Button_X", JoyConController.Right.ButtonX.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConController_Button_Y", JoyConController.Right.ButtonY.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConController_Button_Plus", JoyConController.Right.ButtonPlus.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConController_Button_R", JoyConController.Right.ButtonR.ToString());
|
||||
Parser.SetValue("Controls_Right_JoyConController_Button_ZR", JoyConController.Right.ButtonZR.ToString());
|
||||
|
||||
Parser.SetValue("GamePad_Enable", GamePadEnable.ToString());
|
||||
Parser.SetValue("GamePad_Index", GamePadIndex.ToString());
|
||||
Parser.SetValue("GamePad_Deadzone", Convert.ToString(GamePadDeadzone,CultureInfo.InvariantCulture));
|
||||
Parser.SetValue("GamePad_Trigger_Threshold", GamePadTriggerThreshold.ToString());
|
||||
|
||||
Parser.SetValue("Default_Game_Directory", DefaultGameDirectory);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using ImGuiNET;
|
||||
using Ryujinx.HLE.Input;
|
||||
using Ryujinx.Common.Input;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Ryujinx.UI.Widgets
|
||||
|
@ -10,10 +10,11 @@ namespace Ryujinx.UI.Widgets
|
|||
static bool OpenFolderPicker;
|
||||
static string CurrentPath;
|
||||
|
||||
static IniParser IniParser;
|
||||
static FilePicker FolderPicker;
|
||||
static JoyCon CurrentJoyConLayout;
|
||||
static Page CurrentPage = Page.General;
|
||||
static IniParser IniParser;
|
||||
static FilePicker FolderPicker;
|
||||
static JoyConKeyboard KeyboardInputLayout;
|
||||
static JoyConController ControllerInputLayout;
|
||||
static Page CurrentPage = Page.General;
|
||||
|
||||
static ConfigurationWidget()
|
||||
{
|
||||
|
@ -26,7 +27,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if(!ConfigIntialized)
|
||||
{
|
||||
CurrentJoyConLayout = Config.FakeJoyCon;
|
||||
KeyboardInputLayout = Config.JoyConKeyboard;
|
||||
ConfigIntialized = true;
|
||||
}
|
||||
|
||||
|
@ -103,7 +104,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (ImGui.Button("Apply", new Vector2(Values.ButtonWidth, Values.ButtonHeight)))
|
||||
{
|
||||
Config.FakeJoyCon = CurrentJoyConLayout;
|
||||
Config.JoyConKeyboard = KeyboardInputLayout;
|
||||
}
|
||||
ImGui.SameLine();
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Up");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.StickUp).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.StickUp).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[0] = true;
|
||||
|
@ -109,7 +109,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.StickUp = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.StickUp = (int)pressedKey;
|
||||
Toggles[0] = false;
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Down");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.StickDown).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.StickDown).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[1] = true;
|
||||
|
@ -130,7 +130,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.StickDown = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.StickDown = (int)pressedKey;
|
||||
Toggles[1] = false;
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Left");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.StickLeft).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.StickLeft).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[2] = true;
|
||||
|
@ -150,7 +150,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.StickLeft = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.StickLeft = (int)pressedKey;
|
||||
Toggles[2] = false;
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Right");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.StickRight).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.StickRight).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[3] = true;
|
||||
|
@ -170,7 +170,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.StickRight = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.StickRight = (int)pressedKey;
|
||||
Toggles[3] = false;
|
||||
}
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Up");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.StickUp).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.StickUp).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[4] = true;
|
||||
|
@ -199,7 +199,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.StickUp = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.StickUp = (int)pressedKey;
|
||||
|
||||
Toggles[4] = false;
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Down");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.StickDown).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.StickDown).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[5] = true;
|
||||
|
@ -220,7 +220,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.StickDown = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.StickDown = (int)pressedKey;
|
||||
Toggles[5] = false;
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Left");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.StickLeft).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.StickLeft).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[6] = true;
|
||||
|
@ -239,7 +239,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.StickLeft = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.StickLeft = (int)pressedKey;
|
||||
Toggles[6] = false;
|
||||
}
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Right");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.StickRight).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.StickRight).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[7] = true;
|
||||
|
@ -259,7 +259,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.StickRight = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.StickRight = (int)pressedKey;
|
||||
Toggles[7] = false;
|
||||
}
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Up");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.DPadUp).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.DPadUp).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[8] = true;
|
||||
|
@ -287,7 +287,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.DPadUp = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.DPadUp = (int)pressedKey;
|
||||
Toggles[8] = false;
|
||||
}
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Down");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.DPadDown).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.DPadDown).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[9] = true;
|
||||
|
@ -307,7 +307,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.DPadDown = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.DPadDown = (int)pressedKey;
|
||||
Toggles[9] = false;
|
||||
}
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Left");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.DPadLeft).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.DPadLeft).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[10] = true;
|
||||
|
@ -326,7 +326,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.DPadLeft = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.DPadLeft = (int)pressedKey;
|
||||
Toggles[10] = false;
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Right");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.DPadRight).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.DPadRight).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[11] = true;
|
||||
|
@ -346,7 +346,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.DPadRight = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.DPadRight = (int)pressedKey;
|
||||
Toggles[11] = false;
|
||||
}
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("A");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.ButtonA).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.ButtonA).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[12] = true;
|
||||
|
@ -374,7 +374,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.ButtonA = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.ButtonA = (int)pressedKey;
|
||||
Toggles[12] = false;
|
||||
}
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("B");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.ButtonB).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.ButtonB).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[13] = true;
|
||||
|
@ -394,7 +394,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.ButtonB = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.ButtonB = (int)pressedKey;
|
||||
Toggles[13] = false;
|
||||
}
|
||||
}
|
||||
|
@ -403,7 +403,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("X");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.ButtonX).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.ButtonX).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[14] = true;
|
||||
|
@ -413,7 +413,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.ButtonX = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.ButtonX = (int)pressedKey;
|
||||
Toggles[14] = false;
|
||||
}
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("Y");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.ButtonY).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.ButtonY).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[15] = true;
|
||||
|
@ -433,7 +433,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.ButtonY = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.ButtonY = (int)pressedKey;
|
||||
Toggles[15] = false;
|
||||
}
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("L");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.ButtonL).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.ButtonL).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[17] = true;
|
||||
|
@ -463,7 +463,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.ButtonL = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.ButtonL = (int)pressedKey;
|
||||
Toggles[17] = false;
|
||||
}
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("R");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.ButtonR).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.ButtonR).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[16] = true;
|
||||
|
@ -484,7 +484,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.ButtonR = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.ButtonR = (int)pressedKey;
|
||||
Toggles[16] = false;
|
||||
}
|
||||
}
|
||||
|
@ -493,7 +493,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("ZL");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.ButtonZL).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.ButtonZL).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[19] = true;
|
||||
|
@ -503,7 +503,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.ButtonZL = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.ButtonZL = (int)pressedKey;
|
||||
Toggles[19] = false;
|
||||
}
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("ZR");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.ButtonZR).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.ButtonZR).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[18] = true;
|
||||
|
@ -523,7 +523,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.ButtonZR = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.ButtonZR = (int)pressedKey;
|
||||
Toggles[18] = false;
|
||||
}
|
||||
}
|
||||
|
@ -541,7 +541,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("-");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Left.ButtonMinus).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Left.ButtonMinus).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[20] = true;
|
||||
|
@ -551,7 +551,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Left.ButtonMinus = (int)pressedKey;
|
||||
KeyboardInputLayout.Left.ButtonMinus = (int)pressedKey;
|
||||
Toggles[20] = false;
|
||||
}
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ namespace Ryujinx.UI.Widgets
|
|||
ImGuiNative.igBeginGroup();
|
||||
ImGui.Text("+");
|
||||
|
||||
if (ImGui.Button(((Key)CurrentJoyConLayout.Right.ButtonPlus).ToString(),
|
||||
if (ImGui.Button(((Key)KeyboardInputLayout.Right.ButtonPlus).ToString(),
|
||||
new Vector2(ContentWidth, 50)))
|
||||
{
|
||||
Toggles[21] = true;
|
||||
|
@ -570,7 +570,7 @@ namespace Ryujinx.UI.Widgets
|
|||
{
|
||||
if (GetKey(ref pressedKey))
|
||||
{
|
||||
CurrentJoyConLayout.Right.ButtonPlus = (int)pressedKey;
|
||||
KeyboardInputLayout.Right.ButtonPlus = (int)pressedKey;
|
||||
Toggles[21] = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue