Closed ABNTGeneric closed 2 hours ago
Turns out, 'input_player_using_gamepad' does not account for the gamepad being disconnected. It only checks to see if the last connected source was a gamepad. For code like this to work, you must also run a check to see if the source is connected using 'input_player_connected'
Will add a note to the docs to reflect this, thanks for following up with your final findings
The function 'input_player_using_gamepad' returns true while the function 'input_player_get_gamepad' still returns -1. This happens when the code is run on the same frame as the async "gamepad connected" event. I'm using standard xInput and PS4 controllers and the function input_player_get_gamepad otherwise returns the proper index.