Nope. I can't fine the gamepad index in a loop. I absolute the loopindex as the gamepad id then do the poll input request. However I do map index to a controller input slot. Let's just say it's a pain.
I don't know the exact names at the moment
Repeat gamepad.count
-- check for button down then callback function("controller.DOWN", loopindex, gamepad.lastbutton)
-- check for button release then callback function("controller.UP", loopindex, gamepad.lastbutton)
-- check for xAxis !=0 then callback function("controller.axis_x_change", loopindex, gamepad.xaxis )
... repeat for each input type.
and I do that for every input type I need. And it's annoying, because then i'm polling for every possible change every tick rather than just letting the even occur then finding which one it occured on.
GeometriX
That works too. While I do some more dancing with mine to map the gamepad.id /loopindex count. I prefer controller input agnostic. So the input does not tie immediately to the player. But that's me.