Adding input capabilities description to device list.
1.1 --- a/HidDevice.cs Sun Feb 15 21:48:07 2015 +0100
1.2 +++ b/HidDevice.cs Sun Feb 15 22:13:33 2015 +0100
1.3 @@ -39,6 +39,7 @@
1.4 //Capabilities
1.5 public HIDP_CAPS Capabilities { get { return iCapabilities; } }
1.6 private HIDP_CAPS iCapabilities;
1.7 + public string InputCapabilitiesDescription { get; private set; }
1.8 //Input Button Capabilities
1.9 public HIDP_BUTTON_CAPS[] InputButtonCapabilities { get { return iInputButtonCapabilities; } }
1.10 private HIDP_BUTTON_CAPS[] iInputButtonCapabilities;
1.11 @@ -138,7 +139,7 @@
1.12
1.13 handle.Close();
1.14
1.15 - SetFriendlyName();
1.16 + SetFriendlyName();
1.17
1.18 //Get our HID descriptor pre-parsed data
1.19 PreParsedData = Win32.RawInput.GetPreParsedData(hRawInputDevice);
1.20 @@ -157,6 +158,8 @@
1.21 throw new Exception("HidDevice: HidP_GetCaps failed: " + status.ToString());
1.22 }
1.23
1.24 + SetInputCapabilitiesDescription();
1.25 +
1.26 //Get input button caps if needed
1.27 if (Capabilities.NumberInputButtonCaps > 0)
1.28 {
1.29 @@ -180,10 +183,14 @@
1.30 throw new Exception("HidDevice: HidP_GetValueCaps failed: " + status.ToString());
1.31 }
1.32 }
1.33 + }
1.34
1.35 -
1.36 -
1.37 -
1.38 + /// <summary>
1.39 + ///
1.40 + /// </summary>
1.41 + void SetInputCapabilitiesDescription()
1.42 + {
1.43 + InputCapabilitiesDescription = "[ Input Capabilities ] Button: " + Capabilities.NumberInputButtonCaps + " - Value: " + Capabilities.NumberInputValueCaps + " - Data indices: " + Capabilities.NumberInputDataIndices;
1.44 }
1.45
1.46 /// <summary>
2.1 --- a/RawInput.cs Sun Feb 15 21:48:07 2015 +0100
2.2 +++ b/RawInput.cs Sun Feb 15 22:13:33 2015 +0100
2.3 @@ -202,6 +202,11 @@
2.4 node.Nodes.Add("UsagePage / UsageCollection: 0x" + hidDevice.Info.hid.usUsagePage.ToString("X4") + " / 0x" + hidDevice.Info.hid.usUsage.ToString("X4"));
2.5 }
2.6
2.7 + if (hidDevice.InputCapabilitiesDescription != null)
2.8 + {
2.9 + node.Nodes.Add(hidDevice.InputCapabilitiesDescription);
2.10 + }
2.11 +
2.12 node.Nodes.Add(hidDevice.Name);
2.13 }
2.14 }
3.1 --- a/Win32Hid.cs Sun Feb 15 21:48:07 2015 +0100
3.2 +++ b/Win32Hid.cs Sun Feb 15 22:13:33 2015 +0100
3.3 @@ -112,7 +112,6 @@
3.4 [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
3.5 public struct HIDP_CAPS
3.6 {
3.7 -
3.8 /// USAGE->USHORT->unsigned short
3.9 public ushort Usage;
3.10