Put a text object in the layout and on a button press, set it to the gamepad's last button expression. This will tell you the index of every button on the controller. You can select a button from the dropdown list, but I don't know how the buttons map if it's not an XBox 360 style controller...
(BTW the zero-based index of the gamepad is so you can use multiple gamepads in one game, e.g. for two player)