mirror of
https://github.com/yawut/SDL.git
synced 2026-09-07 00:25:37 -05:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user