SDL_JoystickEventState(3)

๐Ÿ“ฆ version 1.2.15, in debian bookworm, nixos 26.05, nixpkgs unstable, ubuntu jammy

๐Ÿ’– SDL_JoystickEventState(3) ๐Ÿ’–

okay bestie, welcome to the SDL API Reference โœจ this one lives in the SDL manual, section 3, and it's literally the on/off switch for joystick event polling ๐ŸŽฎ๐Ÿฆ‹


๐ŸŒธ NAME ๐ŸŒธ

SDL_JoystickEventState โ€” turn joystick event polling on or off ๐Ÿ’…


โœจ SYNOPSIS โœจ

#include "SDL.h"

int SDL_JoystickEventState(int state);

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

so like, this function is the girl when it comes to enabling or disabling joystick event processing ๐Ÿซถ

when joystick event processing is disabled, no events are gonna come find you โ€” you have to go get them yourself. that means you update the joystick states with SDL_JoystickUpdate and read the joystick info manually, like a main character doing her own detective work ๐Ÿ”โœจ

and state? it's one of three iconic options:

  • SDL_QUERY โ€” ask, don't tell ๐Ÿ’ฌ
  • SDL_ENABLE โ€” yes ma'am, turn it on ๐Ÿ‘‘
  • SDL_IGNORE โ€” nope, we're off duty ๐Ÿ™ˆ
Note: Joystick event handling is prefered (that's their spelling, not mine, and we respect the icon's choices ๐Ÿ’€๐Ÿ’–)

๐Ÿ”ฅ RETURN VALUE ๐Ÿ”ฅ

  • if state is SDL_QUERY, you get the current state back ๐ŸŽ
  • otherwise, you get the new processing state back โœจ

either way bestie, you're getting a return value, no crumbs ๐Ÿ’…


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • SDL Joystick Functions
  • SDL_JoystickUpdate
  • SDL_JoyAxisEvent
  • SDL_JoyBallEvent
  • SDL_JoyButtonEvent
  • SDL_JoyHatEvent

and that's the whole vibe ๐Ÿ’œ this page came from the SDL manual, dated Tue 11 Sep 2001, 22:59 โ€” yes, she's an elder icon and she still ate ๐Ÿ“ go forth and poll your joysticks, ily, bye ๐Ÿ‘‘๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from