gpt4 book ai didi

c# - UWP:从HID捕获卡读取输入字节

转载 作者:行者123 更新时间:2023-12-03 00:23:29 27 4
gpt4 key购买 nike

我的UWP应用程序将捕获卡标识为HidDevice:

HidDevice device = await HidDevice.FromIdAsync(deviceId, Windows.Storage.FileAccessMode.Read);
是否可以从HID捕获卡读取输入字节? (就像 OBS一样)。
也许在InputStream上有一些DataReader?
我在 list 中的隐藏功能:
<DeviceCapability Name="humaninterfacedevice">

<Device Id="vidpid:534d 2109">
<Function Type="usage:0005 *" />
<Function Type="usage:FF00 0001" />
<Function Type="usage:ff00 *" />
</Device>

</DeviceCapability>

最佳答案

read input bytes from HID Capture Card


当然,您可以读取 HidDevice输入字节。 HidDevice包含 InputReportReceived事件,该事件可用于在输入数据时显示数据。有关更多信息,请引用官方 document
device.InputReportReceived += async (sender, args) =>
{
HidInputReport inputReport = args.Report;
IBuffer buffer = inputReport.Data;

// Create a DispatchedHandler as we are interracting with the UI directly and the
// thread that this function is running on might not be the UI thread;
// if a non-UI thread modifies the UI, an exception is thrown.

await this.Dispatcher.RunAsync(
CoreDispatcherPriority.Normal,
new DispatchedHandler(() =>
{
info.Text += "\nHID Input Report: " + inputReport.ToString() +
"\nTotal number of bytes received: " + buffer.Length.ToString();
}));
};

关于c# - UWP:从HID捕获卡读取输入字节,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63700417/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com