libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.79k stars 1.82k forks source link

WinRT game controllers not calling SDL_CONTROLLERDEVICEADDED - 2.0.18 Prerelease #5017

Closed RustyMoyher closed 2 years ago

RustyMoyher commented 2 years ago

I'm unable to get game controllers to work during testing in WinRT/UWP of the Nov 26 Prerelease of 2.0.18. Neither controllers plugged in at launch or hot plugging the Xbox One controllers call the SDL_CONTROLLERDEVICEADDED event.

I built the WinRT source using Visual Studio 2017 and set the platforms tools to v141.

I’m not sure if this is a new issue or is related to 4321. The previous workaround of using SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1"); doesn't help either.

slouken commented 2 years ago

This is fixed in the latest code. I'm not sure why XInput stopped reporting controllers as connected, but Microsoft has been recommending WGI for UWP apps for a while, so I went ahead and implemented that support.

RustyMoyher commented 2 years ago

Excellent! Tested this issue with the latest tip in WinRT/UWP. Everything is working well so far. 👍

slouken commented 2 years ago

Great! :)