語法
參數
此方法沒有參數。傳回值
類型:uint32_t 裝置上的控制器切換開關數目;如果裝置沒有控制器切換開關,則為 0。備註
控制器切換開關是裝置上未經對應的原始多位置切換開關,例如苦力帽開關和方向鍵。當 GetSupportedInput 傳回的值包含GameInputKindControllerSwitch 時,裝置即具有控制器切換開關。來自該裝置且包含 GameInputKindControllerSwitch 的讀數,會透過 IGameInputReading::GetControllerSwitchCount 回報相同數目的切換開關。
使用傳回的值來決定您傳遞給 GetControllerSwitchInfo 或 IGameInputReading::GetControllerSwitchState 之陣列的大小。在裝置連線期間,切換開關數目不會變更。
在 GameInput v3 及更早版本中,此資訊可從 GameInputControllerInfo 結構的 controllerSwitchCount 成員取得,該結構由 IGameInputDevice::GetDeviceInfo 所傳回 GameInputDeviceInfo 結構的 controllerInfo 成員參考。
需求
標頭: GameInput.h 程式庫: gameinput.lib 支援的平台: Windows、XBOX One 系列主機和 XBOX Series 主機另請參閱
GameInput 概觀GetControllerSwitchInfo
IGameInputReading::GetControllerSwitchCount
IGameInputReading::GetControllerSwitchState
IGameInputDevice
