joystick hat

Does anyone know if there is an easier way to read the direction of the hat of a joystick into a Pyton script, than by hooking the script up to 8 sensors (one for each direction)

kind regards
Smitje

if I recall, in python the hat position is a single value

which actually is a bitfield, so 1 is up, 2 is right, 4 is down, 8 is left, 3 is up right, 6 is down right, 12 is down left and 9 is up left… or something it should be rambled about in the docs

I was playing with the joystick sensor too today :slight_smile: . A stupid question :expressionless: :
what is the hat?

The little jiggle-button on top of the joystick.

I just coined the term jiggle-button. :smiley: