joystick_exists(id);
Argument | Description |
---|---|
id | The id of the joystick to check for (1 or 2). |
Returns: Boolean
This function will return true if a joystick/gamepad with the given id is connected or false if it is not. The id can be either 1 or 2 as GameMaker: Studio only accepts input
from a maximum of two joysticks/gamepads.
NOTE: This function is only available for Windows.
if joystick_exists(1) || joystick_exists(2)
{
global.Control = 3;
}
The above code checks to see if a joystick or gamepad is connected to the device and, if so, sets a global variable.