Try me in the Hague

This commit is contained in:
Isaac Marovitz 2023-05-18 22:51:08 -04:00 committed by Isaac Marovitz
parent 2b0fce3e9d
commit 44a53e1cdf
3 changed files with 148 additions and 60 deletions

View file

@ -139,9 +139,6 @@ namespace Ryujinx.Ava.UI.Views.Input
case "RightJoystick": case "RightJoystick":
viewModel.Config.RightJoystick = (StickInputId)e.Key; viewModel.Config.RightJoystick = (StickInputId)e.Key;
break; break;
default:
Console.WriteLine(button.Name);
break;
} }
} }
}; };

View file

@ -74,9 +74,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsTriggerZL}" Text="{locale:Locale ControllerSettingsTriggerZL}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonZl">
<TextBlock <TextBlock
Text="{Binding Config.ButtonZl, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonZl, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -90,9 +90,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsTriggerL}" Text="{locale:Locale ControllerSettingsTriggerL}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonL">
<TextBlock <TextBlock
Text="{Binding Config.ButtonL, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonL, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -106,9 +106,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonMinus}" Text="{locale:Locale ControllerSettingsButtonMinus}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonMinus">
<TextBlock <TextBlock
Text="{Binding Config.ButtonMinus, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonMinus, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -141,9 +141,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickButton}" Text="{locale:Locale ControllerSettingsStickButton}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="LeftStickButton">
<TextBlock <TextBlock
Text="{Binding Config.LeftStickButton, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.LeftStickButton, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -158,9 +158,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickUp}" Text="{locale:Locale ControllerSettingsStickUp}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="LeftStickUp">
<TextBlock <TextBlock
Text="{Binding Config.LeftStickUp, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.LeftStickUp, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -175,9 +175,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickDown}" Text="{locale:Locale ControllerSettingsStickDown}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="LeftStickDown">
<TextBlock <TextBlock
Text="{Binding Config.LeftStickDown, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.LeftStickDown, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -192,9 +192,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickLeft}" Text="{locale:Locale ControllerSettingsStickLeft}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="LeftStickLeft">
<TextBlock <TextBlock
Text="{Binding Config.LeftStickLeft, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.LeftStickLeft, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -209,9 +209,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickRight}" Text="{locale:Locale ControllerSettingsStickRight}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="LeftStickRight">
<TextBlock <TextBlock
Text="{Binding Config.LeftStickRight, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.LeftStickRight, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -245,9 +245,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsDPadUp}" Text="{locale:Locale ControllerSettingsDPadUp}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="DpadUp">
<TextBlock <TextBlock
Text="{Binding Config.DpadUp, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.DpadUp, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -262,9 +262,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsDPadDown}" Text="{locale:Locale ControllerSettingsDPadDown}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="DpadDown">
<TextBlock <TextBlock
Text="{Binding Config.DpadDown, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.DpadDown, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -279,9 +279,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsDPadLeft}" Text="{locale:Locale ControllerSettingsDPadLeft}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="DpadLeft">
<TextBlock <TextBlock
Text="{Binding Config.DpadLeft, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.DpadLeft, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -296,9 +296,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsDPadRight}" Text="{locale:Locale ControllerSettingsDPadRight}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="DpadRight">
<TextBlock <TextBlock
Text="{Binding Config.DpadRight, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.DpadRight, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -334,9 +334,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsLeftSR}" Text="{locale:Locale ControllerSettingsLeftSR}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="LeftButtonSr">
<TextBlock <TextBlock
Text="{Binding Config.LeftButtonSr, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.LeftButtonSr, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -352,9 +352,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsLeftSL}" Text="{locale:Locale ControllerSettingsLeftSL}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="LeftButtonSl">
<TextBlock <TextBlock
Text="{Binding Config.LeftButtonSl, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.LeftButtonSl, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -370,9 +370,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsRightSR}" Text="{locale:Locale ControllerSettingsRightSR}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="RightButtonSr">
<TextBlock <TextBlock
Text="{Binding Config.RightButtonSr, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.RightButtonSr, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -388,9 +388,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsRightSL}" Text="{locale:Locale ControllerSettingsRightSL}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="RightButtonSl">
<TextBlock <TextBlock
Text="{Binding Config.RightButtonSl, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.RightButtonSl, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -437,9 +437,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsTriggerZR}" Text="{locale:Locale ControllerSettingsTriggerZR}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonZr">
<TextBlock <TextBlock
Text="{Binding Config.ButtonZr, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonZr, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -455,9 +455,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsTriggerR}" Text="{locale:Locale ControllerSettingsTriggerR}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonR">
<TextBlock <TextBlock
Text="{Binding Config.ButtonR, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonR, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -473,9 +473,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonPlus}" Text="{locale:Locale ControllerSettingsButtonPlus}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonPlus">
<TextBlock <TextBlock
Text="{Binding Config.ButtonPlus, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonPlus, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -508,9 +508,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonA}" Text="{locale:Locale ControllerSettingsButtonA}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonA">
<TextBlock <TextBlock
Text="{Binding Config.ButtonA, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonA, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -525,9 +525,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonB}" Text="{locale:Locale ControllerSettingsButtonB}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonB">
<TextBlock <TextBlock
Text="{Binding Config.ButtonB, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonB, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -542,9 +542,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonX}" Text="{locale:Locale ControllerSettingsButtonX}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonX">
<TextBlock <TextBlock
Text="{Binding Config.ButtonX, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonX, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -559,9 +559,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonY}" Text="{locale:Locale ControllerSettingsButtonY}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="ButtonY">
<TextBlock <TextBlock
Text="{Binding Config.ButtonY, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.ButtonY, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -594,9 +594,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickButton}" Text="{locale:Locale ControllerSettingsStickButton}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="RightStickButton">
<TextBlock <TextBlock
Text="{Binding Config.RightStickButton, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.RightStickButton, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -611,9 +611,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickUp}" Text="{locale:Locale ControllerSettingsStickUp}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="RightStickUp">
<TextBlock <TextBlock
Text="{Binding Config.RightStickUp, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.RightStickUp, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -628,9 +628,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickDown}" Text="{locale:Locale ControllerSettingsStickDown}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="RightStickDown">
<TextBlock <TextBlock
Text="{Binding Config.RightStickDown, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.RightStickDown, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -645,9 +645,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickLeft}" Text="{locale:Locale ControllerSettingsStickLeft}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="RightStickLeft">
<TextBlock <TextBlock
Text="{Binding Config.RightStickLeft, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.RightStickLeft, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@ -662,9 +662,9 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickRight}" Text="{locale:Locale ControllerSettingsStickRight}"
TextAlignment="Center" /> TextAlignment="Center" />
<ToggleButton> <ToggleButton Name="RightStickRight">
<TextBlock <TextBlock
Text="{Binding Config.RightStickRight, Mode=TwoWay, Converter={StaticResource Key}}" Text="{Binding Config.RightStickRight, Converter={StaticResource Key}}"
TextAlignment="Center" /> TextAlignment="Center" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>

View file

@ -7,6 +7,7 @@ using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.ViewModels.Input; using Ryujinx.Ava.UI.ViewModels.Input;
using Ryujinx.Input; using Ryujinx.Input;
using Ryujinx.Input.Assigner; using Ryujinx.Input.Assigner;
using Key = Ryujinx.Common.Configuration.Hid.Key;
namespace Ryujinx.Ava.UI.Views.Input namespace Ryujinx.Ava.UI.Views.Input
{ {
@ -64,7 +65,97 @@ namespace Ryujinx.Ava.UI.Views.Input
{ {
if (e.IsAssigned) 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;
}
} }
}; };