gamepad_get_description

This function will return a string with the description of the given gamepad, for example, a PS3 controller may return a string similar to "PLAYSTATION(R)3 Controller", or an Xbox 360 controller could return "Xbox 360 Controller (XInput STANDARD GAMEPAD)". This string is hardware dependant and the returned value will depend on the gamepad plugged into the device "slot" that is being checked.

 

Syntax:

gamepad_get_description(device);

Argument Type Description
device Real Which gamepad "slot" to get the name of.

 

Returns:

String

 

Example:

for (var i = 0; i < _gamepad_count; i++)
{
    var _gamepad = gamepads[i];
    if (gamepad_is_connected(_gamepad))
    {
        draw_text(32, 32 + (i * 32), gamepad_get_description(_gamepad));
    }
    else
    {
        draw_text(32, 32 + (i * 32), "Gamepad not found");
    }
}

The above code will loop through all gamepads in the array gamepads to check for connected devices and then draw some text to the screen based on whether a gamepad is connected to the slot or not.

This follows the Gamepad Movement example on Movement And Controls where the gamepads array is set up.