瀏覽代碼

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.
Misty De Meo 9 年之前
父節點
當前提交
ca89d9b593
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/joystick/darwin/SDL_sysjoystick.c

+ 2 - 0
src/joystick/darwin/SDL_sysjoystick.c

@@ -248,6 +248,8 @@ AddHIDElement(const void *value, void *parameter)
                         switch (usage) {
                         switch (usage) {
                             case kHIDUsage_Sim_Rudder:
                             case kHIDUsage_Sim_Rudder:
                             case kHIDUsage_Sim_Throttle:
                             case kHIDUsage_Sim_Throttle:
+                            case kHIDUsage_Sim_Accelerator:
+                            case kHIDUsage_Sim_Brake:
                                 if (!ElementAlreadyAdded(cookie, pDevice->firstAxis)) {
                                 if (!ElementAlreadyAdded(cookie, pDevice->firstAxis)) {
                                     element = (recElement *) SDL_calloc(1, sizeof (recElement));
                                     element = (recElement *) SDL_calloc(1, sizeof (recElement));
                                     if (element) {
                                     if (element) {