glfwSetJoystickCallback function
! @brief Sets the joystick configuration callback.
This function sets the joystick configuration callback, or removes the currently set callback. This is called when a joystick is connected to or disconnected from the system.
For joystick connection and disconnection events to be delivered on all
platforms, you need to call one of the event processing
(@ref events)
functions. Joystick disconnection may also be detected and the callback
called by joystick functions. The function will then return whatever it
returns if the joystick is not present.
@paramin
callback The new callback, or NULL
to remove the currently set
callback.
@return The previously set callback, or NULL
if no callback was set or the
library had not been initialized
(@ref intro_init).
@callback_signature
@code
void function_name(int jid, int event)
@endcode
For more information about the callback parameters, see the
function pointer type
(@ref GLFWjoystickfun).
@errors Possible errors include @ref GLFW_NOT_INITIALIZED.
@thread_safety This function must only be called from the main thread.
@sa @ref joystick_event
@since Added in version 3.2.
@ingroup input
GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback)
Implementation
GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback) {
final glfwSetJoystickCallbackLookupFunction = libglfw.lookupFunction<
GLFWjoystickfun Function(GLFWjoystickfun callback),
GLFWjoystickfun Function(
GLFWjoystickfun callback)>('glfwSetJoystickCallback');
return glfwSetJoystickCallbackLookupFunction(callback);
}