|
|
|
@ -67,10 +67,11 @@ static void addJoystickElement(_GLFWjoydevice* joystick, IOHIDElementRef element |
|
|
|
|
usagePage = IOHIDElementGetUsagePage(elementRef); |
|
|
|
|
usage = IOHIDElementGetUsage(elementRef); |
|
|
|
|
|
|
|
|
|
if ((elementType == kIOHIDElementTypeInput_Axis) || |
|
|
|
|
(elementType == kIOHIDElementTypeInput_Button) || |
|
|
|
|
(elementType == kIOHIDElementTypeInput_Misc)) |
|
|
|
|
{ |
|
|
|
|
if ((elementType != kIOHIDElementTypeInput_Axis) && |
|
|
|
|
(elementType != kIOHIDElementTypeInput_Button) && |
|
|
|
|
(elementType != kIOHIDElementTypeInput_Misc)) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
switch (usagePage) |
|
|
|
|
{ |
|
|
|
|
case kHIDPage_GenericDesktop: |
|
|
|
@ -115,19 +116,6 @@ static void addJoystickElement(_GLFWjoydevice* joystick, IOHIDElementRef element |
|
|
|
|
element->maxReport = IOHIDElementGetLogicalMax(elementRef); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
CFArrayRef array = IOHIDElementGetChildren(elementRef); |
|
|
|
|
if (array) |
|
|
|
|
{ |
|
|
|
|
if (CFGetTypeID(array) == CFArrayGetTypeID()) |
|
|
|
|
{ |
|
|
|
|
CFRange range = { 0, CFArrayGetCount(array) }; |
|
|
|
|
CFArrayApplyFunction(array, range, getElementsCFArrayHandler, joystick); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Adds an element to the specified joystick |
|
|
|
|
// |
|
|
|
|