Skip to content

Use RawInput + Windows.Gaming.Input on Windows#116101

Closed
Nintorch wants to merge 1 commit intogodotengine:masterfrom
Nintorch:rawinput-wgi
Closed

Use RawInput + Windows.Gaming.Input on Windows#116101
Nintorch wants to merge 1 commit intogodotengine:masterfrom
Nintorch:rawinput-wgi

Conversation

@Nintorch
Copy link
Contributor

@Nintorch Nintorch commented Feb 9, 2026

Alternative to #116055
Closes godotengine/godot-proposals#8620

Instead of possibly doing a lot of work to introduce GameInput and remove DirectInput/XInput, this PR enables the RawInput backend for SDL that also uses "Windows.Gaming.Input" API to better handle more than 4 XInput controllers without removing previous drivers in the short term.

Advantages:

  • We can (or should be able to) use more than 4 XInput controllers on Windows
  • XInput is still working inside of RawInput backend, so there shouldn't be any regressions for the first 4 connected XInput controllers
  • Compared to the GameInput solution, this PR shouldn't have any conflicts with Add support for joypad haptics (force feedback) #114642 since DirectInput is still supported and RawInput/WGI don't handle DirectInput-only controllers (I tested it)
  • Compared to the GameInput solution, RawInput and WGI seem to be available in MinGW by default (because GCC Windows template compiles just fine)

Small disadvantages:

  • For XInput controllers above the 4 controller limit, triggers, trigger rumble and joypad vibration won't work if the application is unfocused since WGI ignores devices in this case and RawInput doesn't support these features at all or properly. Trigger rumble won't work for any controllers in an unfocused application.
  • Since XInput is now mostly only available through RawInput backend, xinput_index field of Input.get_joy_info() won't be available unless we explicitly disable RawInput through SDL_JOYSTICK_RAWINPUT environment variable
  • Compared to the GameInput solution, this one doesn't allow Godot games to be published in Microsoft Store 😅(note that it's a small/negligible disadvantage) No longer the case.

TODO:

  • Fix xinput_index being missing

@Nintorch Nintorch marked this pull request as ready for review February 9, 2026 15:22
@Nintorch Nintorch requested a review from a team as a code owner February 9, 2026 15:22
@Chaosus Chaosus added this to the 4.x milestone Feb 9, 2026
@Nintorch
Copy link
Contributor Author

Nintorch commented Feb 9, 2026

I just tried Xbox One's trigger rumble for the first time!
I downloaded SDL's testcontroller that I conveniently placed in a separate archive (see libsdl-org/SDL#14961 ) and before running it I set "SDL_JOYSTICK_RAWINPUT" environment variable to "1"
Now when I move the left or right sticks vertically trigger rumble works! So we probably should be able to implement it later too!

@Nintorch
Copy link
Contributor Author

Superseded by #116055 , but if that PR won't work out we can re-open this one.

@Nintorch Nintorch closed this Feb 17, 2026
@Nintorch Nintorch removed this from the 4.x milestone Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for using more than 4 simultaneous controllers on Windows

2 participants

Comments