diff --git a/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml.cs b/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml.cs index 65f32504d..11149af0d 100644 --- a/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml.cs +++ b/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml.cs @@ -139,9 +139,6 @@ namespace Ryujinx.Ava.UI.Views.Input case "RightJoystick": viewModel.Config.RightJoystick = (StickInputId)e.Key; break; - default: - Console.WriteLine(button.Name); - break; } } }; diff --git a/src/Ryujinx.Ava/UI/Views/Input/KeyboardInputView.axaml b/src/Ryujinx.Ava/UI/Views/Input/KeyboardInputView.axaml index bd5e71b6e..5e5348c63 100644 --- a/src/Ryujinx.Ava/UI/Views/Input/KeyboardInputView.axaml +++ b/src/Ryujinx.Ava/UI/Views/Input/KeyboardInputView.axaml @@ -74,9 +74,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsTriggerZL}" TextAlignment="Center" /> - + @@ -90,9 +90,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsTriggerL}" TextAlignment="Center" /> - + @@ -106,9 +106,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsButtonMinus}" TextAlignment="Center" /> - + @@ -141,9 +141,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickButton}" TextAlignment="Center" /> - + @@ -158,9 +158,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickUp}" TextAlignment="Center" /> - + @@ -175,9 +175,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickDown}" TextAlignment="Center" /> - + @@ -192,9 +192,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickLeft}" TextAlignment="Center" /> - + @@ -209,9 +209,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickRight}" TextAlignment="Center" /> - + @@ -245,9 +245,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsDPadUp}" TextAlignment="Center" /> - + @@ -262,9 +262,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsDPadDown}" TextAlignment="Center" /> - + @@ -279,9 +279,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsDPadLeft}" TextAlignment="Center" /> - + @@ -296,9 +296,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsDPadRight}" TextAlignment="Center" /> - + @@ -334,9 +334,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsLeftSR}" TextAlignment="Center" /> - + @@ -352,9 +352,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsLeftSL}" TextAlignment="Center" /> - + @@ -370,9 +370,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsRightSR}" TextAlignment="Center" /> - + @@ -388,9 +388,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsRightSL}" TextAlignment="Center" /> - + @@ -437,9 +437,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsTriggerZR}" TextAlignment="Center" /> - + @@ -455,9 +455,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsTriggerR}" TextAlignment="Center" /> - + @@ -473,9 +473,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsButtonPlus}" TextAlignment="Center" /> - + @@ -508,9 +508,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsButtonA}" TextAlignment="Center" /> - + @@ -525,9 +525,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsButtonB}" TextAlignment="Center" /> - + @@ -542,9 +542,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsButtonX}" TextAlignment="Center" /> - + @@ -559,9 +559,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsButtonY}" TextAlignment="Center" /> - + @@ -594,9 +594,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickButton}" TextAlignment="Center" /> - + @@ -611,9 +611,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickUp}" TextAlignment="Center" /> - + @@ -628,9 +628,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickDown}" TextAlignment="Center" /> - + @@ -645,9 +645,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickLeft}" TextAlignment="Center" /> - + @@ -662,9 +662,9 @@ VerticalAlignment="Center" Text="{locale:Locale ControllerSettingsStickRight}" TextAlignment="Center" /> - + diff --git a/src/Ryujinx.Ava/UI/Views/Input/KeyboardInputView.axaml.cs b/src/Ryujinx.Ava/UI/Views/Input/KeyboardInputView.axaml.cs index 46984c388..ffbe55fe0 100644 --- a/src/Ryujinx.Ava/UI/Views/Input/KeyboardInputView.axaml.cs +++ b/src/Ryujinx.Ava/UI/Views/Input/KeyboardInputView.axaml.cs @@ -7,6 +7,7 @@ using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.ViewModels.Input; using Ryujinx.Input; using Ryujinx.Input.Assigner; +using Key = Ryujinx.Common.Configuration.Hid.Key; namespace Ryujinx.Ava.UI.Views.Input { @@ -64,7 +65,97 @@ namespace Ryujinx.Ava.UI.Views.Input { if (e.IsAssigned) { - (DataContext as KeyboardInputViewModel).parentModel.IsModified = true; + var viewModel = (DataContext as KeyboardInputViewModel); + viewModel.parentModel.IsModified = true; + + // More crimes against humanity incoming + switch (button.Name) + { + case "ButtonZl": + viewModel.Config.ButtonZl = (Key)e.Key; + break; + case "ButtonL": + viewModel.Config.ButtonL = (Key)e.Key; + break; + case "ButtonMinus": + viewModel.Config.ButtonMinus = (Key)e.Key; + break; + case "LeftStickButton": + viewModel.Config.LeftStickButton = (Key)e.Key; + break; + case "LeftStickUp": + viewModel.Config.LeftStickUp = (Key)e.Key; + break; + case "LeftStickDown": + viewModel.Config.LeftStickDown = (Key)e.Key; + break; + case "LeftStickRight": + viewModel.Config.LeftStickRight = (Key)e.Key; + break; + case "LeftStickLeft": + viewModel.Config.LeftStickLeft = (Key)e.Key; + break; + case "DpadUp": + viewModel.Config.DpadUp = (Key)e.Key; + break; + case "DpadDown": + viewModel.Config.DpadDown = (Key)e.Key; + break; + case "DpadLeft": + viewModel.Config.DpadLeft = (Key)e.Key; + break; + case "DpadRight": + viewModel.Config.DpadRight = (Key)e.Key; + break; + case "LeftButtonSr": + viewModel.Config.LeftButtonSr = (Key)e.Key; + break; + case "LeftButtonSl": + viewModel.Config.LeftButtonSl = (Key)e.Key; + break; + case "RightButtonSr": + viewModel.Config.RightButtonSr = (Key)e.Key; + break; + case "RightButtonSl": + viewModel.Config.RightButtonSl = (Key)e.Key; + break; + case "ButtonZr": + viewModel.Config.ButtonZr = (Key)e.Key; + break; + case "ButtonR": + viewModel.Config.ButtonR = (Key)e.Key; + break; + case "ButtonPlus": + viewModel.Config.ButtonPlus = (Key)e.Key; + break; + case "ButtonA": + viewModel.Config.ButtonA = (Key)e.Key; + break; + case "ButtonB": + viewModel.Config.ButtonB = (Key)e.Key; + break; + case "ButtonX": + viewModel.Config.ButtonX = (Key)e.Key; + break; + case "ButtonY": + viewModel.Config.ButtonY = (Key)e.Key; + break; + case "RightStickButton": + viewModel.Config.RightStickButton = (Key)e.Key; + break; + case "RightStickUp": + viewModel.Config.RightStickUp = (Key)e.Key; + break; + case "RightStickDown": + viewModel.Config.RightStickDown = (Key)e.Key; + break; + case "RightStickRight": + viewModel.Config.RightStickRight = (Key)e.Key; + break; + case "RightStickLeft": + viewModel.Config.RightStickLeft = (Key)e.Key; + break; + } } };