mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-09 20:29:11 +00:00
Address Feedback
This commit is contained in:
parent
e8dccaa7e2
commit
6e21eba625
1 changed files with 10 additions and 9 deletions
|
@ -256,25 +256,26 @@ namespace Ryujinx
|
||||||
{
|
{
|
||||||
if (entry.Value != HidEmulatedDevices.HostDevice.None)
|
if (entry.Value != HidEmulatedDevices.HostDevice.None)
|
||||||
{
|
{
|
||||||
|
bool IsKeyboard = entry.Value == HidEmulatedDevices.HostDevice.Keyboard;
|
||||||
Device.Hid.SetJoyconButton(
|
Device.Hid.SetJoyconButton(
|
||||||
entry.Key,
|
entry.Key,
|
||||||
(entry.Key == HidControllerId.CONTROLLER_HANDHELD) ? HidControllerLayouts.Handheld_Joined : HidControllerLayouts.Joined,
|
(entry.Key == HidControllerId.CONTROLLER_HANDHELD) ? HidControllerLayouts.Handheld_Joined : HidControllerLayouts.Joined,
|
||||||
(entry.Value == HidEmulatedDevices.HostDevice.Keyboard) ? CurrentButtonsKeyboard : CurrentButtonsGamePad[GetGamePadIndexFromHostDevice(entry.Value)],
|
IsKeyboard ? CurrentButtonsKeyboard : CurrentButtonsGamePad[GetGamePadIndexFromHostDevice(entry.Value)],
|
||||||
(entry.Value == HidEmulatedDevices.HostDevice.Keyboard) ? LeftJoystickKeyboard : LeftJoystickGamePad [GetGamePadIndexFromHostDevice(entry.Value)],
|
IsKeyboard ? LeftJoystickKeyboard : LeftJoystickGamePad [GetGamePadIndexFromHostDevice(entry.Value)],
|
||||||
(entry.Value == HidEmulatedDevices.HostDevice.Keyboard) ? RightJoystickKeyboard : RightJoystickGamePad [GetGamePadIndexFromHostDevice(entry.Value)]);
|
IsKeyboard ? RightJoystickKeyboard : RightJoystickGamePad [GetGamePadIndexFromHostDevice(entry.Value)]);
|
||||||
Device.Hid.SetJoyconButton(
|
Device.Hid.SetJoyconButton(
|
||||||
entry.Key,
|
entry.Key,
|
||||||
HidControllerLayouts.Main,
|
HidControllerLayouts.Main,
|
||||||
(entry.Value == HidEmulatedDevices.HostDevice.Keyboard) ? CurrentButtonsKeyboard : CurrentButtonsGamePad[GetGamePadIndexFromHostDevice(entry.Value)],
|
IsKeyboard ? CurrentButtonsKeyboard : CurrentButtonsGamePad[GetGamePadIndexFromHostDevice(entry.Value)],
|
||||||
(entry.Value == HidEmulatedDevices.HostDevice.Keyboard) ? LeftJoystickKeyboard : LeftJoystickGamePad [GetGamePadIndexFromHostDevice(entry.Value)],
|
IsKeyboard ? LeftJoystickKeyboard : LeftJoystickGamePad [GetGamePadIndexFromHostDevice(entry.Value)],
|
||||||
(entry.Value == HidEmulatedDevices.HostDevice.Keyboard) ? RightJoystickKeyboard : RightJoystickGamePad [GetGamePadIndexFromHostDevice(entry.Value)]);
|
IsKeyboard ? RightJoystickKeyboard : RightJoystickGamePad [GetGamePadIndexFromHostDevice(entry.Value)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int GetGamePadIndexFromHostDevice(HidEmulatedDevices.HostDevice hostDevice)
|
private int GetGamePadIndexFromHostDevice(HidEmulatedDevices.HostDevice HostDevice)
|
||||||
{
|
{
|
||||||
switch (hostDevice)
|
switch (HostDevice)
|
||||||
{
|
{
|
||||||
case HidEmulatedDevices.HostDevice.GamePad_0: return 0;
|
case HidEmulatedDevices.HostDevice.GamePad_0: return 0;
|
||||||
case HidEmulatedDevices.HostDevice.GamePad_1: return 1;
|
case HidEmulatedDevices.HostDevice.GamePad_1: return 1;
|
||||||
|
@ -287,7 +288,7 @@ namespace Ryujinx
|
||||||
case HidEmulatedDevices.HostDevice.GamePad_8: return 8;
|
case HidEmulatedDevices.HostDevice.GamePad_8: return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
throw new ArgumentException("Not a valid GamePad Device");
|
||||||
}
|
}
|
||||||
|
|
||||||
private new void RenderFrame()
|
private new void RenderFrame()
|
||||||
|
|
Loading…
Reference in a new issue