mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-06-23 09:17:48 +00:00
[Win] Fixed XInput y-axis and trigger range
This commit is contained in:
parent
ea66a828bf
commit
8237b889c9
|
@ -58,12 +58,12 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
state.SetIsConnected(true);
|
state.SetIsConnected(true);
|
||||||
|
|
||||||
state.SetAxis(JoystickAxis.Axis0, xstate.GamePad.ThumbLX);
|
state.SetAxis(JoystickAxis.Axis0, (short)xstate.GamePad.ThumbLX);
|
||||||
state.SetAxis(JoystickAxis.Axis1, xstate.GamePad.ThumbLY);
|
state.SetAxis(JoystickAxis.Axis1, (short)(-xstate.GamePad.ThumbLY));
|
||||||
state.SetAxis(JoystickAxis.Axis2, (short)Common.HidHelper.ScaleValue(xstate.GamePad.LeftTrigger, 0, byte.MaxValue, 0, short.MaxValue));
|
state.SetAxis(JoystickAxis.Axis2, (short)Common.HidHelper.ScaleValue(xstate.GamePad.LeftTrigger, 0, byte.MaxValue, short.MinValue, short.MaxValue));
|
||||||
state.SetAxis(JoystickAxis.Axis3, xstate.GamePad.ThumbRX);
|
state.SetAxis(JoystickAxis.Axis3, (short)xstate.GamePad.ThumbRX);
|
||||||
state.SetAxis(JoystickAxis.Axis4, xstate.GamePad.ThumbRY);
|
state.SetAxis(JoystickAxis.Axis4, (short)(-xstate.GamePad.ThumbRY));
|
||||||
state.SetAxis(JoystickAxis.Axis5, (short)Common.HidHelper.ScaleValue(xstate.GamePad.RightTrigger, 0, byte.MaxValue, 0, short.MaxValue));
|
state.SetAxis(JoystickAxis.Axis5, (short)Common.HidHelper.ScaleValue(xstate.GamePad.RightTrigger, 0, byte.MaxValue, short.MinValue, short.MaxValue));
|
||||||
|
|
||||||
state.SetButton(JoystickButton.Button0, (xstate.GamePad.Buttons & XInputButtons.A) != 0);
|
state.SetButton(JoystickButton.Button0, (xstate.GamePad.Buttons & XInputButtons.A) != 0);
|
||||||
state.SetButton(JoystickButton.Button1, (xstate.GamePad.Buttons & XInputButtons.B) != 0);
|
state.SetButton(JoystickButton.Button1, (xstate.GamePad.Buttons & XInputButtons.B) != 0);
|
||||||
|
|
Loading…
Reference in a new issue