Darwin: fix detection of Xbox One S controller
authorMisty De Meo <mistydemeo@gmail.com>
Wed, 25 Jan 2017 22:22:05 -0800
changeset 10853f4a771647ecd
parent 10852 494d0f56ae7a
child 10854 ca523d8f1af2
Darwin: fix detection of Xbox One S controller

Firmware revision 3.1.1221.0 changes the mapping of the Xbox One S
controller in Bluetooth mode. Aside from changing the layout of
other buttons, this revision also changes the triggers to act as
Accelerator and Brake axes from the simulation controls page.

The Darwin sysjoystick code didn't previously map anything at these
axes, making it impossible to detect input on these two buttons.
src/joystick/darwin/SDL_sysjoystick.c
     1.1 --- a/src/joystick/darwin/SDL_sysjoystick.c	Tue Jan 24 19:38:01 2017 -0800
     1.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c	Wed Jan 25 22:22:05 2017 -0800
     1.3 @@ -248,6 +248,8 @@
     1.4                          switch (usage) {
     1.5                              case kHIDUsage_Sim_Rudder:
     1.6                              case kHIDUsage_Sim_Throttle:
     1.7 +                            case kHIDUsage_Sim_Accelerator:
     1.8 +                            case kHIDUsage_Sim_Brake:
     1.9                                  if (!ElementAlreadyAdded(cookie, pDevice->firstAxis)) {
    1.10                                      element = (recElement *) SDL_calloc(1, sizeof (recElement));
    1.11                                      if (element) {