Sort by HID usage, which makes more sense and is more cross-platform
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403236
This commit is contained in:
parent
2b777b84e2
commit
eb0b9dc85d
2 changed files with 15 additions and 12 deletions
|
@ -331,20 +331,22 @@ HIDAddElement(CFTypeRef refElement, recDevice * pDevice)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element && headElement) { /* add to list */
|
if (element && headElement) { /* add to list */
|
||||||
pDevice->elements++;
|
recElement *elementPrevious = NULL;
|
||||||
if (NULL == *headElement)
|
recElement *elementCurrent = *headElement;
|
||||||
*headElement = element;
|
while (elementCurrent && usage >= elementCurrent->usage) {
|
||||||
else {
|
elementPrevious = elementCurrent;
|
||||||
recElement *elementPrevious, *elementCurrent;
|
elementCurrent = elementCurrent->pNext;
|
||||||
elementCurrent = *headElement;
|
|
||||||
while (elementCurrent) {
|
|
||||||
elementPrevious = elementCurrent;
|
|
||||||
elementCurrent = elementPrevious->pNext;
|
|
||||||
}
|
|
||||||
elementPrevious->pNext = element;
|
|
||||||
}
|
}
|
||||||
element->pNext = NULL;
|
if (elementPrevious) {
|
||||||
|
elementPrevious->pNext = element;
|
||||||
|
} else {
|
||||||
|
*headElement = element;
|
||||||
|
}
|
||||||
|
element->usagePage = usagePage;
|
||||||
|
element->usage = usage;
|
||||||
|
element->pNext = elementCurrent;
|
||||||
HIDGetElementInfo(refElement, element);
|
HIDGetElementInfo(refElement, element);
|
||||||
|
pDevice->elements++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
struct recElement
|
struct recElement
|
||||||
{
|
{
|
||||||
IOHIDElementCookie cookie; /* unique value which identifies element, will NOT change */
|
IOHIDElementCookie cookie; /* unique value which identifies element, will NOT change */
|
||||||
|
long usagePage, usage; /* HID usage */
|
||||||
long min; /* reported min value possible */
|
long min; /* reported min value possible */
|
||||||
long max; /* reported max value possible */
|
long max; /* reported max value possible */
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue