Skip to main content

GameInputButtonMapping

Describes how a button maps to the controller.

Syntax

Members

controllerElementKind
Type: GameInputElementKind
The kind of controller element that the button is mapped from. controllerIndex
Type: uint32_t
The index of the controller element that the button is mapped from. The index is zero-based and is relative to other elements of the same kind. This index is relevant whether the button is mapped from an axis, another button, or a switch. isInverted
Type: bool
Indicates whether the axis value is inverted before being translated to a button value. For example if the range of values given by the axis is [0 - 1], where 0 is not pressed and 1 is pressed, then 1 is expected to stand for not pressed and 0 for pressed. This member is only valid when the button is mapped from an axis. switchPosition
Type: GameInputSwitchPosition
The position of the switch that the button is mapped from. When a given switch on this switch position is pressed, then the button is considered pressed. This member is only valid when the button is mapped from a switch.

Remarks

This mapping information shares internal information provided by the device or protocol about how it expects to be interpreted for a given input. In some cases we do not share the totality of this information and instead share what is most relevant to generate a mapping for the given input. For buttons we allow these to be mapped from an axis, another button, or a switch. Which input is the source is given by controllerElementKind. For all source element kinds the index of the source input is given by controllerIndex. This index can then be used with either controller axes, buttons, or switches according to the controllerElementKind value.

See Also

Overview of GameInput
GameInput

Version History

Last modified on August 31, 2026