The joystick to query.
Where to store the number of button states in the returned array. This is set to zero if the joystick is not present or an error occurred.
An array of button states, or NULL
if the joystick is not present or an error occurred.
Generated using TypeDoc
This function returns the state of all buttons of the specified joystick. Each element in the array is either
GLFW_PRESS
orGLFW_RELEASE
.For backward compatibility with earlier versions that did not have glfwGetJoystickHats, the button array also includes all hats, each represented as four buttons. The hats are in the same order as returned by glfwGetJoystickHats and are in the order up, right, down and left. To disable these extra buttons, set the GLFW_JOYSTICK_HAT_BUTTONS init hint before initialization.
If the specified joystick is not present this function will return
NULL
but will not generate an error. This can be used instead of first calling glfwJoystickPresent.