joystick_axes(id);
Argument | Description |
---|---|
id | The id of the joystick (1 or 2). |
Returns: Real
This function will return the number of axes that the
joystick/gamepad with the given id has. 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)
{
axes = joystick_axes(1);
}
else
{
axes = -1;
}
The above code checks to see if a joystick or gamepad is connected to the device and then sets a variable to the number of axes it has or -1 if none is connected.