mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 15:44:35 +00:00
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:
|
||||
@ -114,19 +115,6 @@ static void addJoystickElement(_GLFWjoydevice* joystick, IOHIDElementRef element
|
||||
element->minReport = IOHIDElementGetLogicalMin(elementRef);
|
||||
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