joystick_load(id)

From ENIGMA
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Description

Loads the joystick connected with the given index and returns whether or not it was successful. Joysticks 0 and 1 are loaded by default to emulate Game Maker, this function lets you load more than that or see if more are connected. This however is not applicable to Windows as all 16 joysticks are preloaded by default.

Parameters

Parameter Data Type Description
id integer The index of the joystick, must be equal to or larger than 0.

Return Values

boolean: Returns whether or not the joystick was successfully loaded.

Example Call

// demonstrates loading a third joystick
if (joystick_load(2)) {
  // joystick was loaded
} else {
  // joystick must not have been connected
}