GameMaker Studio 2 has a number of dedicated functions that can be used to detect both analog and digital controls from multiple connected gamepads. These functions work similar to the
Device Inputs, in that you can detect up to four different XInput game pads that are connected (and up to 8 DirectInput gamepads) and deal with the input from each one using the same functions. Note that when a gamepad is plugged in to your device (or it is removed) then an asynchronous
System Event is triggered where you can deal with the situation using the appropriate functions.
The gamepad "slots" are indexed from 0 upwards, and the actual slot that a gamepad assigned will depend on a variety of factors, not least of which is the OS that the project is running on. On the
Windows target, slots 0 - 3 inclusive are
only for Xinput gamepads, ie: Xbox360 controllers and compatibles. However you can also check slots 4 - 11 inclusive for
DirectInput gamepads, which means you can detect many other models of controller when connected through these slots. On other platforms, pads may be detected on
any slot that the OS has assigned it, which could slot 3 or slot 20 or more. For example,
Android devices will store bluetooth gamepads in a slot and then reserve that slot for that gamepad in the future, whether it is connected or not, so you
cannot assume that a single connected gamepad is connected to slot 0, as this will probably not be the case.