SDL Wiki
(This is the legacy documentation for stable SDL2, the current stable version; SDL3 is the current development version.)

Draft

THIS PAGE IS A WORK IN PROGRESS ... Please make edits to this page to improve it!

SDL_GameControllerButtonBind

Get the SDL joystick layer binding for this controller button/axis mapping

Header File

Defined in [SDL_gamecontroller.h](https://github.com/libsdl-org/SDL/blob/SDL2/include/SDL_gamecontroller.h), but apps should _only_ `#include "SDL.h"`!

Syntax

typedef struct SDL_GameControllerButtonBind
{
    SDL_GameControllerBindType bindType;
    union
    {
        int button;
        int axis;
        struct {
            int hat;
            int hat_mask;
        } hat;
    } value;

} SDL_GameControllerButtonBind;

Data Fields

SDL_GameControllerBindType

bindType

What kind of control this maps to (button/axis/hat/not mapped)

int

button

The SDL_Joystick button this maps to

int

axis

The SDL_Joystick axis this maps to

int

hat.hat

The SDL_Joystick hat this maps to

int

hat.hat_mask

the mask you need to binary-& with the hat's value with (this probaly corresponds to one direction of the hat)

SDL_GameControllerBindType

CategoryAPI, CategoryAPIStruct, CategoryStruct, CategoryHeader, CategoryDraft


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.