From 114f02ff4952c0a0b92180ec1259101be412a3d6 Mon Sep 17 00:00:00 2001 From: Christopher Lees Date: Fri, 27 Jan 2017 15:48:32 +0000 Subject: [PATCH] Fix: Some joysticks return an invalid HID page of 1 --- src/OpenTK/Platform/Windows/WinRawJoystick.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/OpenTK/Platform/Windows/WinRawJoystick.cs b/src/OpenTK/Platform/Windows/WinRawJoystick.cs index 82f13c6..ccc8242 100644 --- a/src/OpenTK/Platform/Windows/WinRawJoystick.cs +++ b/src/OpenTK/Platform/Windows/WinRawJoystick.cs @@ -83,8 +83,13 @@ namespace OpenTK.Platform.Windows { 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 { - JoystickAxis axis = GetAxis(collection, page, usage); - State.SetAxis(axis, value); + //Certain joysticks (Speedlink Black Widow, PS3 pad connected via USB) + //return an invalid HID page of 1, so + if ((int)usage != 1) + { + JoystickAxis axis = GetAxis(collection, page, usage); + State.SetAxis(axis, value); + } } } -- 2.7.4