|id||The id of the joystick (1 or 2).|
This function will return the number of buttons that the
joystick/gamepad with the given id has, between 1 and 32. 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.
axes = joystick_buttons(1);
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 buttons it has or -1 if none is connected.