SDL 3.0
SDL_GamepadBinding Struct Reference

#include <SDL_gamepad.h>

Data Fields

SDL_GamepadBindingType input_type
union { 
   int   button 
   struct { 
      int   axis 
      int   axis_min 
      int   axis_max 
   }   axis
   struct { 
      int   hat 
      int   hat_mask 
   }   hat
input
SDL_GamepadBindingType output_type
union { 
   SDL_GamepadButton   button 
   struct { 
      SDL_GamepadAxis   axis 
      int   axis_min 
      int   axis_max 
   }   axis
output

Detailed Description

A mapping between one joystick input to a gamepad control.

A gamepad has a collection of several bindings, to say, for example, when joystick button number 5 is pressed, that should be treated like the gamepad's "start" button.

SDL has these bindings built-in for many popular controllers, and can add more with a simple text string. Those strings are parsed into a collection of these structs to make it easier to operate on the data.

Since
This struct is available since SDL 3.2.0.
See also
SDL_GetGamepadBindings

Definition at line 267 of file SDL_gamepad.h.

Field Documentation

◆ [struct] [1/4]

struct { ... } SDL_GamepadBinding::axis

◆ axis [2/4]

SDL_GamepadAxis SDL_GamepadBinding::axis

Definition at line 296 of file SDL_gamepad.h.

◆ [struct] [3/4]

struct { ... } SDL_GamepadBinding::axis

◆ axis [4/4]

int SDL_GamepadBinding::axis

Definition at line 276 of file SDL_gamepad.h.

◆ axis_max

int SDL_GamepadBinding::axis_max

Definition at line 278 of file SDL_gamepad.h.

◆ axis_min

int SDL_GamepadBinding::axis_min

Definition at line 277 of file SDL_gamepad.h.

◆ button [1/2]

SDL_GamepadButton SDL_GamepadBinding::button

Definition at line 292 of file SDL_gamepad.h.

◆ button [2/2]

int SDL_GamepadBinding::button

Definition at line 272 of file SDL_gamepad.h.

◆ [struct] [1/2]

struct { ... } SDL_GamepadBinding::hat

◆ hat [2/2]

int SDL_GamepadBinding::hat

Definition at line 283 of file SDL_gamepad.h.

◆ hat_mask

int SDL_GamepadBinding::hat_mask

Definition at line 284 of file SDL_gamepad.h.

◆ [union]

union { ... } SDL_GamepadBinding::input

◆ input_type

SDL_GamepadBindingType SDL_GamepadBinding::input_type

Definition at line 269 of file SDL_gamepad.h.

◆ [union]

union { ... } SDL_GamepadBinding::output

◆ output_type

SDL_GamepadBindingType SDL_GamepadBinding::output_type

Definition at line 289 of file SDL_gamepad.h.


The documentation for this struct was generated from the following file: