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

语法

参数

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

返回值

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

备注

每个元素都是一个 GameInputRawDeviceReportInfo 结构,其 kind 成员为 GameInputRawInputReport,id 成员为设备定义的报告 ID,size 成员为报告数据的大小(以字节为单位)。 调用 GetInputReportCount 获取输入报告的数量,分配该大小的数组,然后调用 GetInputReportInfo 填充该数组。如果 infoArrayCount 小于输入报告的数量,则只写入前 infoArrayCount 个元素。在设备保持连接期间,设备的输入报告不会更改,因此你可以只查询一次并缓存结果。 对于 IGameInputReading::GetRawReport 从此设备的读数中返回的原始报告,每个元素的 id 成员与 IGameInputRawDeviceReport::GetReportInfo 返回的报告 ID 相匹配。 以下示例演示如何检索设备的输入报告。
在 GameInput v3 及更早版本中,此信息可从 IGameInputDevice::GetDeviceInfo 返回的 GameInputDeviceInfo 结构的 inputReportInfo 成员中获取。

要求

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

另请参阅

GameInput 概述
GetInputReportCount
GameInputRawDeviceReportInfo
GameInputRawDeviceReportKind
IGameInputRawDeviceReport
IGameInputReading::GetRawReport
GameInput 高级主题
IGameInputDevice

版本历史

最后修改于 2026年11月6日