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_CENTEREDSDL_HAT_UPSDL_HAT_RIGHTSDL_HAT_DOWNSDL_HAT_LEFTSDL_HAT_RIGHTUPSDL_HAT_RIGHTDOWNSDL_HAT_LEFTUPSDL_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
- 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