Пример #1
0
        public static NtStatus TryGetButtonCaps(HidPreparsedData preparsedData, HidPReportType reportType, out HidPButtonCaps[] buttonCaps)
        {
            var preparsedDataPtr = HidPreparsedData.GetRawValue(preparsedData);
            var caps             = GetCaps(preparsedData);
            var capsCount        = reportType switch
            {
                HidPReportType.Input => caps.NumberInputButtonCaps,
                HidPReportType.Output => caps.NumberOutputButtonCaps,
                HidPReportType.Feature => caps.NumberFeatureButtonCaps,
                _ => throw new ArgumentException($"Invalid HidPReportType: {reportType}", nameof(reportType)),
            };

            buttonCaps = new HidPButtonCaps[capsCount];

            return(HidP_GetButtonCaps(reportType, buttonCaps, ref capsCount, preparsedDataPtr));
        }
Пример #2
0
 public static ushort[] GetUsages(HidPreparsedData preparsedData, HidPReportType reportType, HidPButtonCaps buttonCaps, byte[] report, int reportLength) =>
 GetUsages(preparsedData, reportType, buttonCaps.UsagePage, buttonCaps.LinkCollection, report, reportLength);
Пример #3
0
 public static NtStatus TryGetUsages(HidPreparsedData preparsedData, HidPReportType reportType, HidPButtonCaps buttonCaps, byte[] report, int reportLength, out ushort[] usageList) =>
 TryGetUsages(preparsedData, reportType, buttonCaps.UsagePage, buttonCaps.LinkCollection, report, reportLength, out usageList);