dinput: OS/X joystick: Check usage page to avoid odd non-button elements found on the 360 controller.
This commit is contained in:
parent
c95011dc5c
commit
6bbec8e660
|
@ -320,6 +320,13 @@ static void get_osx_device_elements(JoystickImpl *device, int axis_map[8])
|
||||||
{
|
{
|
||||||
case kIOHIDElementTypeInput_Button:
|
case kIOHIDElementTypeInput_Button:
|
||||||
{
|
{
|
||||||
|
int usagePage = IOHIDElementGetUsagePage( tIOHIDElementRef );
|
||||||
|
if (usagePage != kHIDPage_Button)
|
||||||
|
{
|
||||||
|
/* avoid strange elements found on the 360 controler */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (buttons < 128)
|
if (buttons < 128)
|
||||||
{
|
{
|
||||||
CFArrayInsertValueAtIndex(device->elementCFArrayRef, (axes+povs+buttons), tIOHIDElementRef);
|
CFArrayInsertValueAtIndex(device->elementCFArrayRef, (axes+povs+buttons), tIOHIDElementRef);
|
||||||
|
|
Loading…
Reference in New Issue