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.1.3.
See also
SDL_GetGamepadBindings

Definition at line 244 of file SDL_gamepad.h.

Field Documentation

◆ axis [1/4]

int SDL_GamepadBinding::axis

Definition at line 253 of file SDL_gamepad.h.

◆  [2/4]

struct { ... } SDL_GamepadBinding::axis

◆ axis [3/4]

SDL_GamepadAxis SDL_GamepadBinding::axis

Definition at line 273 of file SDL_gamepad.h.

◆  [4/4]

struct { ... } SDL_GamepadBinding::axis

◆ axis_max

int SDL_GamepadBinding::axis_max

Definition at line 255 of file SDL_gamepad.h.

◆ axis_min

int SDL_GamepadBinding::axis_min

Definition at line 254 of file SDL_gamepad.h.

◆ button [1/2]

int SDL_GamepadBinding::button

Definition at line 249 of file SDL_gamepad.h.

◆ button [2/2]

SDL_GamepadButton SDL_GamepadBinding::button

Definition at line 269 of file SDL_gamepad.h.

◆ hat [1/2]

int SDL_GamepadBinding::hat

Definition at line 260 of file SDL_gamepad.h.

◆  [2/2]

struct { ... } SDL_GamepadBinding::hat

◆ hat_mask

int SDL_GamepadBinding::hat_mask

Definition at line 261 of file SDL_gamepad.h.

◆ 

union { ... } SDL_GamepadBinding::input

◆ input_type

SDL_GamepadBindingType SDL_GamepadBinding::input_type

Definition at line 246 of file SDL_gamepad.h.

◆ 

union { ... } SDL_GamepadBinding::output

◆ output_type

SDL_GamepadBindingType SDL_GamepadBinding::output_type

Definition at line 266 of file SDL_gamepad.h.


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