From f63824b250fa28582af932cfbeacd06dbe9a3967 Mon Sep 17 00:00:00 2001 From: IntellectualKitty Date: Wed, 7 Sep 2016 15:06:16 -0600 Subject: [PATCH] Added support for joystick button and axis callbacks --- src/internal.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/internal.h b/src/internal.h index a13dd1e4b..73b8a6e72 100644 --- a/src/internal.h +++ b/src/internal.h @@ -463,8 +463,10 @@ struct _GLFWlibrary } vk; struct { - GLFWmonitorfun monitor; - GLFWjoystickfun joystick; + GLFWmonitorfun monitor; + GLFWjoystickfun joystick; + GLFWjoystickbuttonfun joystick_button; + GLFWjoystickaxisfun joystick_axis; } callbacks; // This is defined in the window API's platform.h @@ -953,6 +955,22 @@ void _glfwInputDrop(_GLFWwindow* window, int count, const char** names); */ void _glfwInputJoystickChange(int joy, int event); +/*! @brief Notifies shared code of a joystick button pressed/release action. + * @param[in] joy The joystick that had a button pressed or released. + * @param[in] button The button that was pressed or released. + * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. + * @ingroup event + */ +void _glfwInputJoystickButtonState(int joy, int button, int action); + +/*! @brief Notifies shared code of joystick axis motion. + * @param[in] joy The joystick that had an axis moved. + * @param[in] axis The axis that was moved. + * @param[in] value The current position of the axis. + * @ingroup event + */ +void _glfwInputJoystickAxisMoved(int joy, int axis, float value); + //======================================================================== // Utility functions