Do not recurse over IOHIDElement children.
This commit is contained in:
parent
1a96c294ee
commit
fec6f187d1
@ -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
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user