mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-22 13:51:06 +00:00
Fix HID WinRaw driver to handle PS4 controller
This commit is contained in:
parent
32b0c8e985
commit
8488bb6229
|
@ -81,8 +81,11 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
public void SetAxis(short collection, HIDPage page, short usage, short value)
|
public void SetAxis(short collection, HIDPage page, short usage, short value)
|
||||||
{
|
{
|
||||||
JoystickAxis axis = GetAxis(collection, page, usage);
|
if (page == HIDPage.GenericDesktop || page == HIDPage.Simulation) // set axis only when HIDPage is known by HidHelper.TranslateJoystickAxis() to avoid axis0 to be overwritten by unknown HIDPage
|
||||||
State.SetAxis(axis, value);
|
{
|
||||||
|
JoystickAxis axis = GetAxis(collection, page, usage);
|
||||||
|
State.SetAxis(axis, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetButton(short collection, HIDPage page, short usage, bool value)
|
public void SetButton(short collection, HIDPage page, short usage, bool value)
|
||||||
|
@ -351,6 +354,12 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
if (caps.LogicalMax == 8)
|
if (caps.LogicalMax == 8)
|
||||||
return (HatPosition)value;
|
return (HatPosition)value;
|
||||||
|
else if (caps.LogicalMax == 7)
|
||||||
|
{
|
||||||
|
value++;
|
||||||
|
value %= 9;
|
||||||
|
return (HatPosition)value;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return HatPosition.Centered;
|
return HatPosition.Centered;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue