diff --git a/Source/OpenTK/Platform/Windows/WinRawInput.cs b/Source/OpenTK/Platform/Windows/WinRawInput.cs index 05c728d7..2bdd3053 100644 --- a/Source/OpenTK/Platform/Windows/WinRawInput.cs +++ b/Source/OpenTK/Platform/Windows/WinRawInput.cs @@ -174,6 +174,20 @@ namespace OpenTK.Platform.Windows #endregion + #region GetDeviceList + + public static RawInputDeviceList[] GetDeviceList() + { + int count = WinRawInput.DeviceCount; + RawInputDeviceList[] ridl = new RawInputDeviceList[count]; + for (int i = 0; i < count; i++) + ridl[i] = new RawInputDeviceList(); + Functions.GetRawInputDeviceList(ridl, ref count, API.RawInputDeviceListSize); + return ridl; + } + + #endregion + public override IKeyboardDriver2 KeyboardDriver { get { return keyboard_driver; } diff --git a/Source/OpenTK/Platform/Windows/WinRawMouse.cs b/Source/OpenTK/Platform/Windows/WinRawMouse.cs index 11d7042a..6b0db6ae 100644 --- a/Source/OpenTK/Platform/Windows/WinRawMouse.cs +++ b/Source/OpenTK/Platform/Windows/WinRawMouse.cs @@ -80,14 +80,8 @@ namespace OpenTK.Platform.Windows mice[i] = state; } - int count = WinRawInput.DeviceCount; - RawInputDeviceList[] ridl = new RawInputDeviceList[count]; - for (int i = 0; i < count; i++) - ridl[i] = new RawInputDeviceList(); - Functions.GetRawInputDeviceList(ridl, ref count, API.RawInputDeviceListSize); - // Discover mouse devices - foreach (RawInputDeviceList dev in ridl) + foreach (RawInputDeviceList dev in WinRawInput.GetDeviceList()) { ContextHandle id = new ContextHandle(dev.Device); if (rawids.ContainsKey(id))