gamepad_hat_count

This function will return the total number of hats available for the gamepad connected to the given device "slot". Hats are usually (though not always) direction pads with up/down/left/right buttons.

NOTE On the Windows target, hats are only available on DirectInput controllers (so, from slot 4 upwards).

 

Syntax:

gamepad_hat_count(device);

ArgumentTypeDescription
deviceRealWhich gamepad device "slot" to check.

 

Returns:

Real

 

Example:

h_num = gamepad_hat_count(4);

The above code will return the number of hats available on the gamepad plugged into device "slot" 4 and store the value in the variable h_num.