SDL_JoystickGetHat(3)

✨ SDL_JoystickGetHat(3) ✨

okay so bestie, welcome to the SDL API Reference πŸ’– you're here because you wanna know what a joystick hat is doing right this second, and honestly? valid. iconic. let's go πŸŽ€


🌸 NAME 🌸

SDL_JoystickGetHat</p> β€” get the current state of a joystick hat πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

#include "SDL.h"

Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);

πŸ’… DESCRIPTION πŸ’…

SDL_JoystickGetHat returns the current state of the given hat on the given joystick. that's it. that's the whole vibe. you hand it a joystick, you hand it a hat, it hands you back the tea β˜•βœ¨


🌈 RETURN VALUE 🌈

the current state comes back to you as a Uint8, and here's the part where it gets fruity β€” it's defined as an OR'd combination of one or more of these bad boys:

  • SDL_HAT_CENTERED
  • SDL_HAT_UP
  • SDL_HAT_RIGHT
  • SDL_HAT_DOWN
  • SDL_HAT_LEFT
  • SDL_HAT_RIGHTUP
  • SDL_HAT_RIGHTDOWN
  • SDL_HAT_LEFTUP
  • SDL_HAT_LEFTDOWN
fr fr, "one or more" β€” they get OR'd together, so don't be out here expecting a single lonely value πŸ’€

🫢 SEE ALSO 🫢

  • SDL_JoystickNumHats

and that's the whole page, no cap πŸ’œ this lil slice of the SDL manual is dated Tue 11 Sep 2001, 23:00, brought to you by SDL, and yes she's been serving the same energy since 2001 and she ATE πŸ“βœ¨ mwah, go read your hat states bestie 🧚

πŸ“¦ where this page comes from