[PR #788] Xinput improvements #124

Open
opened 2026-01-29 19:06:30 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/stenzek/duckstation/pull/788

State: closed
Merged: Yes


This PR brings two changes to the XInput backend:

  1. XINPUT_CAPS_FFB_SUPPORTED usage has been retired. This flag is only available with XInput 1.4, and it does not indicate whether or not rumble is supported. MSDN specifically notes:

Device supports force feedback functionality. Note that these force-feedback features beyond rumble are not currently supported through XINPUT on Windows.

As of now, supports_rumble is unused so there were no side effects of this (other than a false negative "rumble not supported" message in the log), but this avoids a future bug which would have certainly occurred once GetControllerRumbleMotorCount becomes used.

  1. Currently, XInput backend only tried to load XInput 1.4 and XInput 9.1.0 libraries. This left Windows 7 users with an inability to poll for the Guide button, because the oldest XInput library does not export a "hidden" XInputGetStateEx function.
    It can be assumed that most users have DirectX End-User Runtimes installed (most games ship it), so there is no harm in trying to load XInput 1.3 before falling back to the oldest version. At the cost of a few more lines of code, (most) Windows 7 users will now be able to poll for the Guide button.
**Original Pull Request:** https://github.com/stenzek/duckstation/pull/788 **State:** closed **Merged:** Yes --- This PR brings two changes to the XInput backend: 1. `XINPUT_CAPS_FFB_SUPPORTED` usage has been retired. This flag is only available with XInput 1.4, **and** it does not indicate whether or not rumble is supported. MSDN specifically notes: > Device supports force feedback functionality. Note that these force-feedback features beyond rumble are not currently supported through XINPUT on Windows. As of now, `supports_rumble` is unused so there were no side effects of this (other than a false negative "rumble not supported" message in the log), but this avoids a future bug which would have certainly occurred once `GetControllerRumbleMotorCount` becomes used. 2. Currently, XInput backend only tried to load XInput 1.4 and XInput 9.1.0 libraries. This left Windows 7 users with an inability to poll for the Guide button, because the oldest XInput library does not export a "hidden" `XInputGetStateEx` function. It can be assumed that most users have DirectX End-User Runtimes installed (most games ship it), so there is no harm in trying to load XInput 1.3 before falling back to the oldest version. At the cost of a few more lines of code, (most) Windows 7 users will now be able to poll for the Guide button.
claunia added the pull-request label 2026-01-29 19:06:30 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/duckstation#124