glfwSetJoystickCallback

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 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.

extern (C) @nogc nothrow __gshared
glfwSetJoystickCallback

Parameters

callback GLFWjoystickfun

The new callback, or null to remove the currently set callback.

Return Value

The previously set callback, or null if no callback was set or the library had not been initialized.

@callback_signature

void function_name(int jid, int event)

For more information about the callback parameters, see the function pointer type.

Errors: Possible errors include @ref GLFW_NOT_INITIALIZED.

Thread Safety

This function must only be called from the main thread.

@sa @ref joystick_event

Meta

Since

Added in version 3.2.

Ingroup: input