glfwGetGamepadName

Returns the human-readable gamepad name for the specified joystick.

This function returns the human-readable name of the gamepad from the gamepad mapping assigned to the specified joystick.

If the specified joystick is not present or does not have a gamepad mapping this function will return null but will not generate an error. Call @ref glfwJoystickPresent to check whether it is present regardless of whether it has a mapping.

extern (C) @nogc nothrow __gshared
const(char)*
glfwGetGamepadName
(
int jid
)

Parameters

jid int

The joystick to query.

Return Value

Type: const(char)*

The UTF-8 encoded name of the gamepad, or null if the joystick is not present, does not have a mapping or an error occurred.

Pointer lifetime

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, the gamepad mappings are updated or the library is terminated.

Thread Safety

This function must only be called from the main thread.

@sa @ref gamepad @sa @ref glfwJoystickIsGamepad

Meta

Since

Added in version 3.3.

Ingroup: input