I discovered that XBox One controllers can be accessed in the background using Raw Input.
I’ve tested that it works using 8 XBox 360 controllers, 1 XBox One controller and a Saitek Dual Analog pad connected at the same time. The XBox controllers had the same limitaiton as accessed via DirectInput i.e. Triggers on the same axis, no guide button and probably no rumble effects.
I think this means that more than 4 (and probably more than 8) XBox One controllers can be accessed in the background via Raw Input but I only have 1 XBox One pad to test with.
Here’s the code I used to test it: https://github.com/supersmo/Using-Raw-Input-API-to-Process-Joystick-Input
(The binary is attached as a release but Avira Antivirus thinks it’s suspicious since it listens to raw input in the background.)
If this is true here’s a summary:
XInput:
Max 4 XBox 360 or XBox One controllers
Always receives input in the background (use gamePad->Suspend(); when the application looses focus to not receive input.)
Limitations:
- Only XInput capable devices.
- Unable to activate the extra 2 rumble motors in a XBox One controller triggers. (Only Windows.Gaming.Input can do that)
Windows.Gaming.Input:
Unlimited number of XBox 360 or XBox One controllers for Win 10? (Tested with 9 controllers now.)
Limitations:
- Controllers can’t be accessed in the background. (Not 100% sure about this. I haven’t been able to get it to work myself and documentation says so at least regarding UWP apps. ref
- Only works on Universal Windows Platforms. (e.g. windows 10)
- The Gamepad class only supports Xbox One certified or Xbox 360 compatible gamepad. ref: (unable to post more than 2 links since I am a new user). Other Gamepads can be accessed via the RawGameController class.
DirectInput:
Unlimited number of controllers (?)
Configurable background input access - See limitation for XBox One controllers.
Limitations:
- XBox 360 and XBox One controllers have triggers on the same axis, no guide button and no rumble.
- XBox One cannot be accessed in the background.
- Windows Store Apps can’t use DirectInput.
- Microsoft no longer recommends using DirectInput.
Raw Input:
Unlimited number of controllers (?)
Configurable background input access.
Limitations:
- XBox 360 and XBox One controllers have triggers on the same axis, no guide button and probably no rumble.
Looks like there are two use cases:
Accessing controllers in the foreground:
If on a UWP device:
Windows.Gaming.Input.Gamepad for all supported controllers. (tested with 9 XBox controllers)
Windows.Gaming.Input.RawGameController, Raw Input or DirectInput for the rest.
Otherwise:
XInput for 4 supported controllers.
Raw Input or DirectInput for the rest.
Accessing controllers in the background:
XInput for 4 supported controllers.
Raw Input for all controllers or just for XBox One controllers and let DirectInput handle the rest.
(EDITS:
- Changed the post to reflect that WIndows.Gaming.Input supports more than 8 XBox controllers for WIndows 10.
- Raw Input can get input in a background application even if the foreground application is using Raw Input.
- Added that XInput can’t activate the 2 extra rumble motors in an XBox One controller’s triggers.
- Added information regarding configurable background input for the different APIs.)