How do you detect a second gamepad for splitscreen?

For those finding this from Google; as of 5.1 this approach has been deprecated.

The updated solution:

1 Like