Compartilhar via


GameInputGamepadState

Describes the state of a gamepad input device.

Syntax

typedef struct GameInputGamepadState {  
    GameInputGamepadButtons buttons;  
    float leftTrigger;  
    float rightTrigger;  
    float leftThumbstickX;  
    float leftThumbstickY;  
    float rightThumbstickX;  
    float rightThumbstickY;  
} GameInputGamepadState  

Members

buttons
Type: GameInputGamepadButtons

The gamepad buttons that are pressed.

leftTrigger
Type: float

Position of left trigger, normalized as a value in the range [0.0, 1.0].

rightTrigger
Type: float

Position of right trigger, normalized as a value in the range [0.0, 1.0].

leftThumbstickX
Type: float

Horizontal position of the left thumbstick, normalized as a value in the range [-1.0, 1.0].

leftThumbstickY
Type: float

Vertical position of the left thumbstick, normalized as a value in the range [-1.0, 1.0].

rightThumbstickX
Type: float

Horizontal position of the right thumbstick, normalized as a value in the range [-1.0, 1.0].

rightThumbstickY
Type: float

Vertical position of the right thumbstick, normalized as a value in the range [-1.0, 1.0].

Remarks

Used by the IGameInputReading:GetGamePadState method.

For more information, see the Getting data from readings section of GameInput readings. For a code example, see A simple gamepad input loop.

Requirements

Header: GameInput.h

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

See also

Overview of GameInput
GameInput