We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3960 - [UWP] XInput forcibly uses old joystick mapping for all WinRT configurations
Summary: [UWP] XInput forcibly uses old joystick mapping for all WinRT configurations
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.1
Hardware: All Windows 10
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-14 18:34 UTC by Ethan Lee
Modified: 2018-02-21 18:16 UTC (History)
1 user (show)

See Also:


Attachments
Patch to fix Win10 XInput binding (909 bytes, patch)
2018-02-21 17:44 UTC, Ethan Lee
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ethan Lee 2017-11-14 18:34:12 UTC
For WinRT, XInput always forces the old code path for all versions:

https://hg.libsdl.org/SDL/file/cf166abbde4a/src/joystick/windows/SDL_xinputjoystick.c#l39

Looking around briefly it seems this might have been required for Windows 8 (?), but I think for Windows 10 the new path is required. In its current form, ABXY is unintentionally mapped to the physical d-pad due to this array:

https://hg.libsdl.org/SDL/file/cf166abbde4a/src/joystick/windows/SDL_xinputjoystick.c#l349

By changing the hardcoded return value to SDL_FALSE, we use the new path where the array properly lines up...

https://hg.libsdl.org/SDL/file/cf166abbde4a/src/joystick/windows/SDL_xinputjoystick.c#l375

... and the issue is resolved for me.
Comment 1 Ethan Lee 2018-02-21 17:44:19 UTC
Created attachment 3177 [details]
Patch to fix Win10 XInput binding

Attached is a patch to fix this issue without changing the behavior on Windows 8, which presumably needed the old path to begin with.
Comment 2 Ryan C. Gordon 2018-02-21 18:16:49 UTC
This patch is now https://hg.libsdl.org/SDL/rev/1a033404c88b, thanks!

(note the commit hash changed because of Windows newlines, so be careful when updating your local copy.)

--ryan.