mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-12 13:45:29 +00:00
WinMM devices with 0 axes and no POV hats are not joysticks/joypads.
This commit is contained in:
parent
3c1676ee40
commit
03cf3ee512
|
@ -32,6 +32,7 @@ using System.Runtime.InteropServices;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using System.Security;
|
using System.Security;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace OpenTK.Platform.Windows
|
namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
|
@ -85,6 +86,12 @@ namespace OpenTK.Platform.Windows
|
||||||
if ((caps.Capabilities & JoystCapsFlags.HasPov) != 0)
|
if ((caps.Capabilities & JoystCapsFlags.HasPov) != 0)
|
||||||
num_axes += 2;
|
num_axes += 2;
|
||||||
|
|
||||||
|
if (num_axes == 0)
|
||||||
|
{
|
||||||
|
Debug.Print("WinMM device {0} has 0 axes. Device will not be used.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
stick = new JoystickDevice<WinMMJoyDetails>(number, num_axes, caps.NumButtons);
|
stick = new JoystickDevice<WinMMJoyDetails>(number, num_axes, caps.NumButtons);
|
||||||
stick.Details = new WinMMJoyDetails(num_axes);
|
stick.Details = new WinMMJoyDetails(num_axes);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue