Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix controller detection on Windows 11 by disabling modern game controller API #471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WizardCM
Copy link
Member

Description

Chromium 117 and above uses Windows.Gaming.Input, which states

Remarks

A Windows application must have focus to receive input from a controller.

This is not useful, as users will have the game focused, not OBS.

Issue raised with Chromium: https://issues.chromium.org/issues/392661398
Original commit that introduced the change:
https://chromiumdash.appspot.com/commit/aeb76145fe766a359f2e2b7432c207cc135113b6

The mentioned flag is set to never expire, so should be available indefinitely.

Ideally, Microsoft should update this API to match the previous (XInput) behaviour, or provide a flag to set the focus policy, which is provided by the IGameInput API. Until then, we will disable WGI.

Motivation and Context

Ultimately, this is a regression. Multiple users have reported being unable to use Gamepad Viewer when using Windows 11 and OBS 31. This is a very common use case of displaying controller inputs on stream.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

Chromium 117 and above uses Windows.Gaming.Input, which states
> A Windows application must have focus to receive input from a controller.

This is not useful, as users will have the game focused, not OBS.

https://issues.chromium.org/issues/392661398
https://chromiumdash.appspot.com/commit/aeb76145fe766a359f2e2b7432c207cc135113b6
@WizardCM WizardCM added the Bug Fix Non-breaking change which fixes an issue label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

1 participant