XInputController.current returns a Gamepad. Should it return a XInputController?
Yeah, think XInputController should probably implement its own .current getter.
It seems that you can get the current gamepad, but you have to check manually whether or not it is an XInput device? This enables our paradigm of writing input code against an abstracted interface, but does it make writing device specific code more difficult?
Not sure what you mean. The static getter here is defined in Gamepad. Writing 'XInputController.current' will simply do the same as 'Gamepad.current' which is why the refactor is suggested. Not sure every device class should have its own getter (for DualShockGamepadHID, for example, it doesn't make sense IMO) but for XInputController, it seems to make sense to add its own static getter.
I mean writing code against Gamepad is "better" in most instances, but writing against XInputController may be necessary for people wanting to target certain specific XInput device capabilities.
@jackpr-unity take a look at my PR https://github.com/Unity-Technologies/InputSystem/pull/416 will this help you with this problem at all?