語法
參數
此方法沒有參數。傳回值
類型: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
