diff --git a/src/input.c b/src/input.c index cceae35da..eb70ceaef 100644 --- a/src/input.c +++ b/src/input.c @@ -598,6 +598,22 @@ GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count) return _glfwPlatformGetJoystickButtons(jid, count); } +GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count) +{ + assert(count != NULL); + *count = 0; + + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); + + if (jid < 0 || jid > GLFW_JOYSTICK_LAST) + { + _glfwInputError(GLFW_INVALID_ENUM, "Invalid joystick %i", jid); + return NULL; + } + + return _glfwPlatformGetJoystickHats(jid, count); +} + GLFWAPI const char* glfwGetJoystickName(int jid) { _GLFW_REQUIRE_INIT_OR_RETURN(NULL);