SDL_GamepadBinding(3type)

SDL_GamepadBinding3type

A mapping between one joystick input to a gamepad control.

Usage

#include "SDL3/SDL.h"

typedef struct SDL_GamepadBinding { 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; } SDL_GamepadBinding;

Header file

Defined in SDL3/SDL_gamepad.h

Overview

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.

Availability

This struct is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.