语法
参数
此方法没有参数。返回值
类型:uint32_t 设备上控制器按钮的数量;如果设备没有控制器按钮,则为 0。备注
控制器按钮是设备上未映射的原始按钮。当 GetSupportedInput 返回的值包含GameInputKindControllerButton 时,设备具有控制器按钮。来自该设备且包含 GameInputKindControllerButton 的读数会通过 IGameInputReading::GetControllerButtonCount 报告相同数量的按钮。
使用返回的值来确定传递给 GetControllerButtonLabels 或 IGameInputReading::GetControllerButtonState 的数组大小。在设备保持连接期间,按钮的数量不会更改。
在 GameInput v3 及更早版本中,此信息可从 GameInputControllerInfo 结构的 controllerButtonCount 成员中获取,该结构由 IGameInputDevice::GetDeviceInfo 返回的 GameInputDeviceInfo 结构的 controllerInfo 成员引用。
要求
头文件: GameInput.h 库: gameinput.lib 支持的平台: Windows、XBOX One 系列主机和 XBOX Series 主机另请参阅
GameInput 概述GetControllerButtonLabels
IGameInputReading::GetControllerButtonCount
IGameInputReading::GetControllerButtonState
IGameInputDevice
