mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 21:45:31 +00:00
Connected XInput driver
This commit is contained in:
parent
062962aeb2
commit
42e6a96a43
|
@ -43,7 +43,8 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
WinRawKeyboard keyboard_driver;
|
WinRawKeyboard keyboard_driver;
|
||||||
WinRawMouse mouse_driver;
|
WinRawMouse mouse_driver;
|
||||||
WinMMJoystick joystick_driver;
|
IGamePadDriver gamepad_driver;
|
||||||
|
IJoystickDriver2 joystick_driver;
|
||||||
|
|
||||||
IntPtr DevNotifyHandle;
|
IntPtr DevNotifyHandle;
|
||||||
static readonly Guid DeviceInterfaceHid = new Guid("4D1E55B2-F16F-11CF-88CB-001111000030");
|
static readonly Guid DeviceInterfaceHid = new Guid("4D1E55B2-F16F-11CF-88CB-001111000030");
|
||||||
|
@ -138,6 +139,15 @@ namespace OpenTK.Platform.Windows
|
||||||
keyboard_driver = new WinRawKeyboard(Parent.Handle);
|
keyboard_driver = new WinRawKeyboard(Parent.Handle);
|
||||||
mouse_driver = new WinRawMouse(Parent.Handle);
|
mouse_driver = new WinRawMouse(Parent.Handle);
|
||||||
joystick_driver = new WinMMJoystick();
|
joystick_driver = new WinMMJoystick();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
gamepad_driver = new XInputJoystick();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("[Win] XInput driver not supported, falling back to WinMM");
|
||||||
|
gamepad_driver = new MappedGamePadDriver();
|
||||||
|
}
|
||||||
|
|
||||||
DevNotifyHandle = RegisterForDeviceNotifications(Parent);
|
DevNotifyHandle = RegisterForDeviceNotifications(Parent);
|
||||||
}
|
}
|
||||||
|
@ -187,12 +197,12 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
public override IGamePadDriver GamePadDriver
|
public override IGamePadDriver GamePadDriver
|
||||||
{
|
{
|
||||||
get { return joystick_driver; }
|
get { return gamepad_driver; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IJoystickDriver2 JoystickDriver
|
public override IJoystickDriver2 JoystickDriver
|
||||||
{
|
{
|
||||||
get { throw new NotImplementedException(); }
|
get { return joystick_driver; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue