public static uint HidP_GetUsageValue(HidPReportType hidPReportType, UsageDescriptor usage, ushort linkCollection, byte[] preparsedData, byte[] report) { uint result = 0; uint success = HidP_GetUsageValue(hidPReportType, usage.UsagePage, linkCollection, usage.Usage, ref result, preparsedData, report, (uint)report.Length); return(result); }
public static NtStatus TryGetUsageValueArray(HidPreparsedData preparsedData, HidPReportType reportType, ushort usagePage, ushort linkCollection, ushort usage, ushort usageValueByteLength, byte[] report, int reportLength, out byte[] usageValue) { var preparsedDataPtr = HidPreparsedData.GetRawValue(preparsedData); usageValue = new byte[usageValueByteLength]; return(HidP_GetUsageValueArray(reportType, usagePage, linkCollection, usage, usageValue, usageValueByteLength, preparsedDataPtr, report, (uint)reportLength)); }
public static extern bool HidP_GetValueCaps( HidPReportType ReportType, [MarshalAs(UnmanagedType.LPArray)] [Out] HidPValueCapsRange[] ValueCaps, ref ushort ValueCapsLength, IntPtr PreparsedData );
public static NtStatus TryGetUsages(HidPreparsedData preparsedData, HidPReportType reportType, ushort usagePage, ushort linkCollection, byte[] report, int reportLength, out ushort[] usageList) { var preparsedDataPtr = HidPreparsedData.GetRawValue(preparsedData); uint usageCount = 0; HidP_GetUsages(reportType, usagePage, linkCollection, null, ref usageCount, preparsedDataPtr, report, (uint)reportLength); usageList = new ushort[usageCount]; return(HidP_GetUsages(reportType, usagePage, linkCollection, usageList, ref usageCount, preparsedDataPtr, report, (uint)reportLength)); }
public static ushort[] HidP_GetUsages(HidPReportType hidPReportType, ushort usagePage, ushort linkCollection, byte[] preparsedData, byte[] report) { ushort[] usageList = new ushort[20]; uint usageLength = (uint)usageList.Length; uint success = HidP_GetUsages(hidPReportType, usagePage, linkCollection, usageList, ref usageLength, preparsedData, report, (uint)report.Length); ushort[] results = new ushort[usageLength]; Buffer.BlockCopy(usageList, 0, results, 0, (int)usageLength * 2); return(results); }
public static NtStatus TryGetValueCaps(HidPreparsedData preparsedData, HidPReportType reportType, out HidPValueCaps[] valueCaps) { var preparsedDataPtr = HidPreparsedData.GetRawValue(preparsedData); var caps = GetCaps(preparsedData); var capsCount = reportType switch { HidPReportType.Input => caps.NumberInputValueCaps, HidPReportType.Output => caps.NumberOutputValueCaps, HidPReportType.Feature => caps.NumberFeatureValueCaps, _ => throw new ArgumentException($"Invalid HidPReportType: {reportType}", nameof(reportType)), }; valueCaps = new HidPValueCaps[capsCount]; return(HidP_GetValueCaps(reportType, valueCaps, ref capsCount, preparsedDataPtr)); }
static extern NtStatus HidP_GetUsageValueArray(HidPReportType reportType, ushort usagePage, ushort linkCollection, ushort usage, [Out] byte[] usageValue, ushort usageValueByteLength, IntPtr preparsedData, byte[] report, uint reportLength);
public static byte[] GetUsageValueArray(HidPreparsedData preparsedData, HidPReportType reportType, HidPValueCaps valueCaps, ushort usage, byte[] report, int reportLength) => GetUsageValueArray(preparsedData, reportType, valueCaps.UsagePage, valueCaps.LinkCollection, usage, (ushort)(valueCaps.BitSize * valueCaps.ReportCount), report, reportLength);
static extern NtStatus HidP_GetScaledUsageValue(HidPReportType reportType, ushort usagePage, ushort linkCollection, ushort usage, out int usageValue, IntPtr preparsedData, byte[] report, uint reportLength);
public static byte[] GetUsageValueArray(HidPreparsedData preparsedData, HidPReportType reportType, ushort usagePage, ushort linkCollection, ushort usage, ushort usageValueByteLength, byte[] report, int reportLength) { TryGetUsageValueArray(preparsedData, reportType, usagePage, linkCollection, usage, usageValueByteLength, report, reportLength, out var usageValue).EnsureSuccess(); return(usageValue); }
static extern NtStatus HidP_GetUsages(HidPReportType reportType, ushort usagePage, ushort linkCollection, [Out] ushort[] usageList, ref uint usageLength, IntPtr preparsedData, byte[] report, uint reportLength);
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);
public static extern NtStatus HidP_GetScaledUsageValue(HidPReportType ReportType, ushort UsagePage, ushort LinkCollection, ushort Usage, out int UsageValue, IntPtr pPreparsedData, byte[] Report, uint ReportLength);
public static extern NtStatus HidP_GetUsages(HidPReportType ReportType, ushort UsagePage, ushort LinkCollection, [Out] ushort[] UsageList, ref uint UsageLength, IntPtr pPreparsedData, byte[] Report, uint ReportLength);
public static int GetScaledUsageValue(HidPreparsedData preparsedData, HidPReportType reportType, ushort usagePage, ushort linkCollection, ushort usage, byte[] report, int reportLength) { TryGetScaledUsageValue(preparsedData, reportType, usagePage, linkCollection, usage, report, reportLength, out var usageValue).EnsureSuccess(); return(usageValue); }
public static NtStatus TryGetUsageValue(HidPreparsedData preparsedData, HidPReportType reportType, HidPValueCaps valueCaps, ushort usage, byte[] report, int reportLength, out int usageValue) => TryGetUsageValue(preparsedData, reportType, valueCaps.UsagePage, valueCaps.LinkCollection, usage, report, reportLength, out usageValue);
public static HidPValueCaps[] GetValueCaps(HidPreparsedData preparsedData, HidPReportType reportType) { TryGetValueCaps(preparsedData, reportType, out var valueCaps).EnsureSuccess(); return(valueCaps); }
public static ushort[] GetUsages(HidPreparsedData preparsedData, HidPReportType reportType, HidPButtonCaps buttonCaps, byte[] report, int reportLength) => GetUsages(preparsedData, reportType, buttonCaps.UsagePage, buttonCaps.LinkCollection, report, reportLength);
static extern NtStatus HidP_GetButtonCaps(HidPReportType reportType, [Out] HidPButtonCaps[] buttonCaps, ref ushort buttonCapsLength, IntPtr preparsedData);
public static ushort[] GetUsages(HidPreparsedData preparsedData, HidPReportType reportType, ushort usagePage, ushort linkCollection, byte[] report, int reportLength) { TryGetUsages(preparsedData, reportType, usagePage, linkCollection, report, reportLength, out var usageList).EnsureSuccess(); return(usageList); }
public static HidPButtonCaps[] GetButtonCaps(HidPreparsedData preparsedData, HidPReportType reportType) { TryGetButtonCaps(preparsedData, reportType, out var buttonCaps).EnsureSuccess(); return(buttonCaps); }
public static int GetScaledUsageValue(HidPreparsedData preparsedData, HidPReportType reportType, HidPValueCaps valueCaps, ushort usage, byte[] report, int reportLength) => GetScaledUsageValue(preparsedData, reportType, valueCaps.UsagePage, valueCaps.LinkCollection, usage, report, reportLength);
public static NtStatus TryGetScaledUsageValue(HidPreparsedData preparsedData, HidPReportType reportType, ushort usagePage, ushort linkCollection, ushort usage, byte[] report, int reportLength, out int usageValue) { var preparsedDataPtr = HidPreparsedData.GetRawValue(preparsedData); return(HidP_GetScaledUsageValue(reportType, usagePage, linkCollection, usage, out usageValue, preparsedDataPtr, report, (uint)reportLength)); }
private static extern uint HidP_GetUsages(HidPReportType hidPReportType, ushort usagePage, ushort linkCollection, ushort[] usageList, ref uint usageLength, byte[] preparsedData, byte[] report, uint reportLength);
static extern NtStatus HidP_GetValueCaps(HidPReportType reportType, [Out] HidPValueCaps[] valueCaps, ref ushort valueCapsLength, IntPtr preparsedData);
public static extern NtStatus HidP_GetValueCaps(HidPReportType ReportType, [Out] HidPValueCaps[] Values, ref ushort ValueCapsLength, IntPtr pPreparsedData);