跳转到主要内容
检索设备定义的原始功能报告的说明。

语法

参数

infoArrayCount   _In_
类型:uint32_t
infoArray 中的元素数量。若要检索所有功能报告,请传递 GetFeatureReportCount 返回的值。 infoArray   _Out_writes_to_opt_(infoArrayCount, return)
类型:GameInputRawDeviceReportInfo*
指向数组的指针,该数组为每个功能报告接收一个结构。可以为 nullptr,在这种情况下不会写入任何内容,并且方法返回 0。

返回值

类型:uint32_t 写入 infoArray 的元素数量。该值为 infoArrayCount 与设备上功能报告数量中的较小者;如果 infoArray 为 nullptr 或设备没有功能报告,则为 0。

备注

每个元素都是一个 GameInputRawDeviceReportInfo 结构,其 kind 成员为 GameInputRawFeatureReport,id 成员为设备定义的报告 ID,size 成员为报告数据的大小(以字节为单位)。 调用 GetFeatureReportCount 获取功能报告的数量,分配该大小的数组,然后调用 GetFeatureReportInfo 填充该数组。如果 infoArrayCount 小于功能报告的数量,则只写入前 infoArrayCount 个元素。在设备保持连接期间,设备的功能报告不会更改,因此你可以只查询一次并缓存结果。 将元素的 id 成员用作 GetRawDeviceFeature 的 reportId 参数以读取报告;或者将其与 GameInputRawFeatureReport 一起用作 CreateRawDeviceReport 的 reportId 参数,以创建可通过 SetRawDeviceFeature 发送的报告。size 成员给出报告数据的字节数。 以下示例演示如何检索设备的功能报告。

要求

头文件: GameInput.h 库: gameinput.lib 支持的平台: Windows、XBOX One 系列主机和 XBOX Series 主机

另请参阅

GameInput 概述
GetFeatureReportCount
GameInputRawDeviceReportInfo
GameInputRawDeviceReportKind
IGameInputRawDeviceReport
GetRawDeviceFeature
SetRawDeviceFeature
CreateRawDeviceReport
GameInput 高级主题
IGameInputDevice

版本历史

最后修改于 2026年11月6日