![]() When a player has 5 or more XInput devices plugged in and unplugs one, one of the extra DirectInput controllers will now be upgraded to XInput, and, I believe, there is no way for us to know which one, so we would need to do the correlation logic again whenever an XInput device is removed, and it will likely cause controllers to swap players.If we still have some virtual devices, after each joystick update in which relevant state changed, do a correlation check to see if any of the 5+ open DirectInput devices are definitively not correlated to an XInput device, and if so, swap them into one of the virtual devices, and emit their current state (presumably an axis change or button press that was used for correlation) as events.Open all XInput-capable DirectInput devices and XInput devices (either immediately, or when the user opens their first joystick), and keep them open (to keep a few bytes of state for correlation), though not emitting events unless they’ve been opened by the user. ![]() When updating the list of devices, if there are more than 4 DirectInput-visible XInput-capable devices, add some virtual “XInput Controller #5”, etc, devices.In order to do this within SDL, I would need to make the following changes: The way to do this is, when there are more than 4 devices, to correlate inputs between DirectInput and XInput devices to determine which DirectInput devices do not have a paired XInput device. These games usually use SDL directly, but apparently newer games (Super Bomberman R, for instance) are using SteamInput which is using SDL in XInput-mode, and not allowing more than 4 players by default (unless you use non-XInput-compatible controllers).įix #1: There’s a relatively simple, fool-proof solution - if, when iterating DirectInput controllers, more than 4 are found, disable XInput as if SDL_XINPUT_ENABLED=0 was set.įix #2: I’d rather get the best of both worlds though - XInput for the first 4 controllers, DirectInput for the rest. ![]() But, I’ve got a lot of games in my Steam library that don’t do that, and have to be coerced into supporting more than 4 XInput-capable devices by disabling XInput via DLL patches or environment variables. Obviously, any game can just disable XInput and, for the most part, things will just be better (especially on low-end systems where, at low framerates, the evented DirectInput will miss fewer button presses than the polling XInput) - unless they want to use both triggers at once or rumble. After seeing threads about people disabling Steam’s self-updating and replacing Steam’s SDL2.dll with versions with that have XInput disabled, in order to fix games that get artificially capped at 4 controllers, I think it’s time to fix SDL to support more than 4 XInput-capable controllers by default.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |