---
name: "SDL_JoystickNumHats"
section: "3"
platform: "linux"
package: "libsdl1.2-dev"
version: "1.2.15+dfsg2-8"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_JoystickNumHats"
---

# SDL\_JoystickNumHats(3)

Get the number of joystick hats

## NAME

SDL\_JoystickNumHats - Get the number of joystick hats

## SYNOPSIS

**#include "SDL.h"**

**int SDL\_JoystickNumHats**(**SDL\_Joystick \*joystick**);

## DESCRIPTION

Return the number of hats available from a previously opened **SDL\_Joystick**.

## RETURN VALUE

Number of hats.

## SEE ALSO

**SDL\_JoystickGetHat**, **SDL\_JoystickOpen**
