logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_GetJoystickHat - Get the current state of a POV hat on a joystick.

Availability

       This function is available since SDL 3.2.0.

Description

       The returned value will be one of the SDL_HAT_* values.

Function Parameters

joystick
              an SDL_Joystick
               structure containing joystick information.

       hat    the hat index to get the state from; indices start at index 0.

Header File

       Defined in SDL3/SDL_joystick.h

Name

       SDL_GetJoystickHat - Get the current state of a POV hat on a joystick.

Return Value

       Returns the current hat position.

See Also

â€ĸ(3), SDL_GetNumJoystickHats(3)

Simple Directmedia Layer                           SDL 3.2.10                              SDL_GetJoystickHat(3)

Synopsis

#include"SDL3/SDL.h"Uint8SDL_GetJoystickHat(SDL_Joystick*joystick,inthat);#defineSDL_HAT_CENTERED0x00u#defineSDL_HAT_UP0x01u#defineSDL_HAT_RIGHT0x02u#defineSDL_HAT_DOWN0x04u#defineSDL_HAT_LEFT0x08u#defineSDL_HAT_RIGHTUP(SDL_HAT_RIGHT|SDL_HAT_UP)#defineSDL_HAT_RIGHTDOWN(SDL_HAT_RIGHT|SDL_HAT_DOWN)#defineSDL_HAT_LEFTUP(SDL_HAT_LEFT|SDL_HAT_UP)#defineSDL_HAT_LEFTDOWN(SDL_HAT_LEFT|SDL_HAT_DOWN)

See Also