New Input System fails to recognize gamepad if it wasn't on before application start

The new Input system will only accept gamepad input if the gamepad in question was already turned on / plugged in before the game started. Once this condition has been met you can turn the pad off and on and it’ll continue to work just fine, but if it wasn’t on in the first place, it’ll never work.

This is a pretty serious regression from the old input system, so I’d like to know if anybody has a workaround.

Please report the bug.

I figured out a workaround. The problem is that when you turn on a gamepad (or perhaps any device) after the game has started, it doesn’t pair it with an InputUser. You need to manually pair it with something like this.

InputSystem.onDeviceChange += (device, change) =>
{
   if(change == InputDeviceChange.Added)
      InputUser.PerformPairingWithDevice(device, PInput.user, InputUserPairingOptions.ForceNoPlatformUserAccountSelection);
};

I haven’t reported it as a bug yet because I thought it might have been intentional behavior, to do with supporting local multiplayer (but then why automatically pair it with the default user if it was on to start?).

Then again, even if it was intentional, it’s ill conceived and not covered by the documentation, so I suppose I should.

Edit: I found the event for when a gamepad is connected.