SDL_JoyAxisEvent(3)

✨ SDL_JoyAxisEvent ✨

okay bestie, gather round πŸ’– this is the SDL API Reference page for SDL_JoyAxisEvent, and it's literally the joystick axis motion event structure. yes, the whole thing. let's go πŸŽ€


🌸 NAME 🌸

SDL_JoyAxisEvent β€” the joystick axis motion event structure. it's giving "your thumbstick moved, and SDL wants you to KNOW" πŸ‘‘


πŸ¦‹ STRUCTURE DEFINITION πŸ¦‹

here's the fit, verbatim, no cap:

typedef struct{
  Uint8 type;
  Uint8 which;
  Uint8 axis;
  Sint16 value;
} SDL_JoyAxisEvent;

πŸŽ€ STRUCTURE DATA πŸŽ€

the fields, one by one, slay:

  • type β€” it's SDL_JOYAXISMOTION. that's the whole personality.
  • which β€” joystick device index. which stick, bestie.
  • axis β€” joystick axis index. which axis on that stick.
  • value β€” the axis value, and its range is -32768 to 32767. periodt.

πŸ’… DESCRIPTION πŸ’…

so SDL_JoyAxisEvent is a member of the SDL_Event union, and it's the one that shows up when an event of type SDL_JOYAXISMOTION gets reported. main character behaviour fr fr πŸ’–

an SDL_JOYAXISMOTION event happens whenever a user moves an axis on the joystick β€” every single wiggle, no exceptions. the which field is the index of the joystick that reported the event, and axis is the index of the axis. (want the full lore? the Joystick section has the detailed explanation, iykyk 🌈) and value is the current position of the axis β€” that's the actual "where is it rn" number. obsessed.


🌟 SEE ALSO 🌟

go read these next, bestie, they're all iconic:

  • SDL_Event
  • Joystick Functions
  • SDL_JoystickEventState
  • SDL_JoystickGetAxis

and that's the page!! mwah πŸ’œ this one came from the SDL source, version SDL, and it was dated Tue 11 Sep 2001, 22:59 β€” a whole legend from the archives, we love her 🫢✨ bye bye πŸ¦‹

πŸ“¦ where this page comes from