logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_GamepadButton - The list of buttons available on a gamepad

Availability

       This enum is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.10                           SDL_GamepadButton(3type)

Description

       For  controllers that use a diamond pattern for the face buttons, the south/east/west/north buttons below
       correspond to the locations in the diamond pattern. For Xbox controllers,  this  would  be  A/B/X/Y,  for
       Nintendo  Switch  controllers,  this  would  be  B/A/Y/X,  for  PlayStation  controllers  this  would  be
       Cross/Circle/Square/Triangle.

       For controllers that don't use a diamond pattern for the face buttons, the south/east/west/north  buttons
       indicate  the buttons labeled A, B, C, D, or 1, 2, 3, 4, or for controllers that aren't labeled, they are
       the primary, secondary, etc. buttons.

       The activate action is often the south button and the cancel action is often the east button, but in some
       regions this is reversed, so your game should allow remapping actions based on user preferences.

       You can query the labels for the face buttons using

       SDL_GetGamepadButtonLabel ()

Header File

       Defined in SDL3/SDL_gamepad.h

Name

       SDL_GamepadButton - The list of buttons available on a gamepad

Synopsis

#include"SDL3/SDL.h"typedefenumSDL_GamepadButton{SDL_GAMEPAD_BUTTON_INVALID=-1,SDL_GAMEPAD_BUTTON_SOUTH,/**<Bottomfacebutton(e.g.XboxAbutton)*/SDL_GAMEPAD_BUTTON_EAST,/**<Rightfacebutton(e.g.XboxBbutton)*/SDL_GAMEPAD_BUTTON_WEST,/**<Leftfacebutton(e.g.XboxXbutton)*/SDL_GAMEPAD_BUTTON_NORTH,/**<Topfacebutton(e.g.XboxYbutton)*/SDL_GAMEPAD_BUTTON_BACK,SDL_GAMEPAD_BUTTON_GUIDE,SDL_GAMEPAD_BUTTON_START,SDL_GAMEPAD_BUTTON_LEFT_STICK,SDL_GAMEPAD_BUTTON_RIGHT_STICK,SDL_GAMEPAD_BUTTON_LEFT_SHOULDER,SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER,SDL_GAMEPAD_BUTTON_DPAD_UP,SDL_GAMEPAD_BUTTON_DPAD_DOWN,SDL_GAMEPAD_BUTTON_DPAD_LEFT,SDL_GAMEPAD_BUTTON_DPAD_RIGHT,SDL_GAMEPAD_BUTTON_MISC1,/**<Additionalbutton(e.g.XboxSeriesXsharebutton,PS5microphonebutton,NintendoSwitchProcapturebutton,AmazonLunamicrophonebutton,GoogleStadiacapturebutton)*/SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1,/**<Upperorprimarypaddle,underyourrighthand(e.g.XboxElitepaddleP1)*/SDL_GAMEPAD_BUTTON_LEFT_PADDLE1,/**<Upperorprimarypaddle,underyourlefthand(e.g.XboxElitepaddleP3)*/SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2,/**<Lowerorsecondarypaddle,underyourrighthand(e.g.XboxElitepaddleP2)*/SDL_GAMEPAD_BUTTON_LEFT_PADDLE2,/**<Lowerorsecondarypaddle,underyourlefthand(e.g.XboxElitepaddleP4)*/SDL_GAMEPAD_BUTTON_TOUCHPAD,/**<PS4/PS5touchpadbutton*/SDL_GAMEPAD_BUTTON_MISC2,/**<Additionalbutton*/SDL_GAMEPAD_BUTTON_MISC3,/**<Additionalbutton*/SDL_GAMEPAD_BUTTON_MISC4,/**<Additionalbutton*/SDL_GAMEPAD_BUTTON_MISC5,/**<Additionalbutton*/SDL_GAMEPAD_BUTTON_MISC6,/**<Additionalbutton*/SDL_GAMEPAD_BUTTON_COUNT}SDL_GamepadButton;

See Also