Fixed bug 2024 - Update OSX Joystick code to fully support Saitek p2500 gamepad

Patrick Maloney

Saitek p2500 (Cyborg Rumble Force Pad) has a D-pad, two analog sticks, and numerous buttons.  SDL 2.x on OSX detected everything except the right-side analog stick.  The right-side stick is considered a 'simulation device' with the axes mapped to throttle and rudder.

The patch adds support for throttle and rudder on the HID simulation page.
This commit is contained in:
Sam Lantinga 2013-08-10 10:55:12 -07:00
parent 42c560b05d
commit e6e79353e8

View file

@ -362,6 +362,22 @@ HIDAddElement(CFTypeRef refElement, recDevice * pDevice)
}
}
break;
case kHIDPage_Simulation:
switch (usage) {
case kHIDUsage_Sim_Rudder:
case kHIDUsage_Sim_Throttle:
element = (recElement *)
NewPtrClear(sizeof(recElement));
if (element) {
pDevice->axes++;
headElement = &(pDevice->firstAxis);
}
break;
default:
break;
}
break;
case kHIDPage_Button:
element = (recElement *)
NewPtrClear(sizeof(recElement));