{{newin|[[0.9.0]]|090|type=function|text=It has been moved from [[love.joystick.getHat]]}}
Gets the direction of the Joystick's [https://en.wikipedia.org/wiki/Joystick#Hat_switch hat].
== Function ==
=== Synopsis ===
<source lang="lua">
direction = Joystick:getHat( hat )
</source>
=== Arguments ===
{{param|number|hat|The index of the hat to be checked.}}
=== Returns ===
{{param|JoystickHat|direction|The direction the hat is pushed.}}
== See Also ==
* [[parent::Joystick]]
* [[Joystick:getHatCount]]
[[Category:Functions]]
{{#set:Description=Gets the direction of a hat.}}
== Other Languages ==
{{i18n|Joystick:getHat}}