[PR #788] [MERGED] Xinput improvements #119

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

📋 Pull Request Information

Original PR: https://github.com/stenzek/duckstation/pull/788
Author: @CookiePLMonster
Created: 8/22/2020
Status: Merged
Merged: 8/23/2020
Merged by: @stenzek

Base: masterHead: xinput-improvements


📝 Commits (2)

  • 1c4bbc8 XInput: Do not use XINPUT_CAPS_FFB_SUPPORTED
  • 8def742 XInput: Try to use XInput 1.3 if 1.4 is not present

📊 Changes

2 files changed (+13 additions, -26 deletions)

View changed files

📝 src/frontend-common/xinput_controller_interface.cpp (+13 -23)
📝 src/frontend-common/xinput_controller_interface.h (+0 -3)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/stenzek/duckstation/pull/788 **Author:** [@CookiePLMonster](https://github.com/CookiePLMonster) **Created:** 8/22/2020 **Status:** ✅ Merged **Merged:** 8/23/2020 **Merged by:** [@stenzek](https://github.com/stenzek) **Base:** `master` ← **Head:** `xinput-improvements` --- ### 📝 Commits (2) - [`1c4bbc8`](https://github.com/stenzek/duckstation/commit/1c4bbc8cde506665de1d1a7b36312c36a1e67a2b) XInput: Do not use XINPUT_CAPS_FFB_SUPPORTED - [`8def742`](https://github.com/stenzek/duckstation/commit/8def7420c4272c12a4d6b7a83ef5b6a84d0c3e65) XInput: Try to use XInput 1.3 if 1.4 is not present ### 📊 Changes **2 files changed** (+13 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/frontend-common/xinput_controller_interface.cpp` (+13 -23) 📝 `src/frontend-common/xinput_controller_interface.h` (+0 -3) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#119