Commit 221708d6 authored by Bob Ziuchkovski's avatar Bob Ziuchkovski Committed by Alexandre Julliard

dinput: Ignore vendor-specific usage pages for joystick elements on Mac.

parent 2de3dc3d
...@@ -640,14 +640,20 @@ static void get_osx_device_elements(JoystickImpl *device, int axis_map[8]) ...@@ -640,14 +640,20 @@ static void get_osx_device_elements(JoystickImpl *device, int axis_map[8])
{ {
IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( elements, idx ); IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( elements, idx );
int type = IOHIDElementGetType( element ); int type = IOHIDElementGetType( element );
int usage_page = IOHIDElementGetUsagePage( element );
TRACE("element %s\n", debugstr_element(element)); TRACE("element %s\n", debugstr_element(element));
if (usage_page >= kHIDPage_VendorDefinedStart)
{
/* vendor pages can repurpose type ids, resulting in incorrect case matches below (e.g. ds4 controllers) */
continue;
}
switch(type) switch(type)
{ {
case kIOHIDElementTypeInput_Button: case kIOHIDElementTypeInput_Button:
{ {
int usage_page = IOHIDElementGetUsagePage( element );
TRACE("kIOHIDElementTypeInput_Button usage_page %d\n", usage_page); TRACE("kIOHIDElementTypeInput_Button usage_page %d\n", usage_page);
if (usage_page != kHIDPage_Button) if (usage_page != kHIDPage_Button)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment