mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 23:05:55 +00:00
WinMM devices with 0 axes and no POV hats are not joysticks/joypads.
This commit is contained in:
parent
ebc3490243
commit
b958f912a8
|
@ -32,6 +32,7 @@ using System.Runtime.InteropServices;
|
|||
using OpenTK.Input;
|
||||
using System.Security;
|
||||
using Microsoft.Win32;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace OpenTK.Platform.Windows
|
||||
{
|
||||
|
@ -85,6 +86,12 @@ namespace OpenTK.Platform.Windows
|
|||
if ((caps.Capabilities & JoystCapsFlags.HasPov) != 0)
|
||||
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.Details = new WinMMJoyDetails(num_axes);
|
||||
|
||||
|
|
Loading…
Reference in a new issue