diff --git a/src/OpenTK/Platform/Common/Hid.cs b/src/OpenTK/Platform/Common/Hid.cs index 27815575..41884694 100644 --- a/src/OpenTK/Platform/Common/Hid.cs +++ b/src/OpenTK/Platform/Common/Hid.cs @@ -141,7 +141,8 @@ namespace OpenTK.Platform.Common // Consumer electronic devices internal enum HIDUsageCD { - ACPan = 0x0238 + ACPan = 0x0238, + ConsumerControl = 0x01 } // Generic desktop usage diff --git a/src/OpenTK/Platform/Windows/API.cs b/src/OpenTK/Platform/Windows/API.cs index 4e84df64..434d2987 100644 --- a/src/OpenTK/Platform/Windows/API.cs +++ b/src/OpenTK/Platform/Windows/API.cs @@ -2126,6 +2126,14 @@ namespace OpenTK.Platform.Windows Target = target; } + public RawInputDevice(HIDUsageCD usage, RawInputDeviceFlags flags, HWND target) + { + UsagePage = HIDPage.Consumer; + Usage = (short)usage; + Flags = flags; + Target = target; + } + public RawInputDevice(HIDUsageSim usage, RawInputDeviceFlags flags, HWND target) { UsagePage = HIDPage.Simulation; diff --git a/src/OpenTK/Platform/Windows/WinRawJoystick.cs b/src/OpenTK/Platform/Windows/WinRawJoystick.cs index 055456b4..fe09fa2f 100644 --- a/src/OpenTK/Platform/Windows/WinRawJoystick.cs +++ b/src/OpenTK/Platform/Windows/WinRawJoystick.cs @@ -194,6 +194,7 @@ namespace OpenTK.Platform.Windows { new RawInputDevice(HIDUsageGD.Joystick, RawInputDeviceFlags.DEVNOTIFY | RawInputDeviceFlags.INPUTSINK, window), new RawInputDevice(HIDUsageGD.GamePad, RawInputDeviceFlags.DEVNOTIFY | RawInputDeviceFlags.INPUTSINK, window), + new RawInputDevice(HIDUsageCD.ConsumerControl, RawInputDeviceFlags.DEVNOTIFY | RawInputDeviceFlags.INPUTSINK, window), }; if (!Functions.RegisterRawInputDevices(DeviceTypes, DeviceTypes.Length, API.RawInputDeviceSize))