SDL_JoyButtonEvent(3)
๐ SDL_JoyButtonEvent(3) ๐
okay bestie, welcome to the SDL API Reference โ this is the page for SDL_JoyButtonEvent, and yes it's exactly as iconic as it sounds ๐ฎโจ
๐ NAME ๐
SDL_JoyButtonEvent โ the joystick button event structure, aka the lil guy that slides into your event queue when someone smashes a button on their controller ๐
๐ STRUCTURE DEFINITION ๐
here's the whole vibe, verbatim, no cap:
typedef struct{
Uint8 type;
Uint8 which;
Uint8 button;
Uint8 state;
} SDL_JoyButtonEvent;
โจ STRUCTURE DATA โจ
four fields, four moods, let's go:
typeโSDL_JOYBUTTONDOWNorSDL_JOYBUTTONUP๐ซถwhichโ the joystick device index, like which controller is talking to you rnbuttonโ the joystick button index, i.e. WHICH buttonstateโSDL_PRESSEDorSDL_RELEASED๐
๐ DESCRIPTION ๐
so, SDL_JoyButtonEvent is a member of the SDL_Event union (it's giving family reunion, everybody's in there), and it shows up whenever an event of type SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP gets reported ๐ธ
an SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP event happens wheneveeer a user presses or releases a button on a joystick. like, any time. that's the whole trigger. periodt ๐
- the field
whichis the index of the joystick that reported the event ๐ - the field
buttonis the index of the button (for a more detailed explaination, go peek at the Joystick section) ๐ stateis the current state of the button, which is eitherSDL_PRESSEDorSDL_RELEASEDโจ
๐ SEE ALSO ๐
go read these next, bestie, they're all in the group chat:
SDL_EventJoystick FunctionsSDL_JoystickEventStateSDL_JoystickGetButton
fr fr, that's the whole page. no missing fields, no skipped flags, we keep every detail around here ๐ฏ
and that's a wrap on our lil SDL moment โ this one's from the SDL docs dated Tue 11 Sep 2001, 22:59, and yeah, iconic date, iconic page. mwah ๐ฉท๐ ๐
๐ฆ where this page comes from
- debian bookworm: libsdl1.2-dev 1.2.15+dfsg2-8 ยท LGPL-2.1-or-later
- nixos 26.05: SDL_sixel 0-unstable-2016-02-06
- nixpkgs unstable: SDL_sixel 0-unstable-2016-02-06
- ubuntu jammy: libsdl1.2-dev 1.2.15+dfsg2-6 ยท LGPL-2.1-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms