We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b7d4490 commit c91f5e2Copy full SHA for c91f5e2
1 file changed
HidSharp/HidDevice.cs
@@ -19,6 +19,7 @@ under the License. */
19
using System.ComponentModel;
20
using System.Globalization;
21
using System.IO;
22
+using System.Linq;
23
using System.Runtime.InteropServices;
24
using HidSharp.Reports;
25
@@ -99,6 +100,13 @@ public virtual byte[] GetRawReportDescriptor()
99
100
throw new NotSupportedException(); // Windows reconstructs it. Linux can retrieve it. MacOS 10.8+ can retrieve it as well.
101
}
102
103
+ public uint GetTopLevelUsage()
104
+ {
105
+ var reportDescriptor = GetReportDescriptor();
106
+ var ditem = reportDescriptor.DeviceItems.FirstOrDefault();
107
+ return ditem.Usages.GetAllValues().FirstOrDefault();
108
+ }
109
+
110
/*
111
TODO
112
public virtual string[] GetDevicePathHierarchy()
0 commit comments