With this function you can find out whether the target platform supports game pads (returns true) or not (returns false).
gamepad_is_supported();
global.GP = gamepad_is_supported();
The above code checks to see if a gamepad is supported and stores the return value in a global variable for future checks.