Partager via


IGameInputReading::GetControllerSwitchState

Retrieves the switch state from a game controller.

Syntax

uint32_t GetControllerSwitchState(  
         uint32_t stateArrayCount,  
         GameInputSwitchPosition* stateArray  
)  

Parameters

stateArrayCount   _In_
Type: uint32_t

The expected number of switches on the game controller. This value can be retrieved by calling IGameInputReading::GetControllerSwitchCount.

stateArray   _Out_writes_(stateArrayCount)
Type: GameInputSwitchPosition*

Pointer to the array of switch states.

Return value

Type: uint32_t

Returns the number of valid buffer entries.

Remarks

Most analog controls on a game controller (joysticks, triggers, sliders, dials, etc.) are surfaced as axes, which are floating-point values linearly normalized to the range [0.0, 1.0]. Most digital inputs are surfaced as buttons, which are simple Boolean values. Hat switches are surfaced as switch values, and their position is represented by one of the GameInputSwitchPosition enumeration values.

Requirements

Header: GameInput.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

Input API Overview
IGameInputReading