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

Signed-off-by: Bob Ziuchkovski <bob.ziuchkovski@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Bob Ziuchkovski 2018-01-07 16:26:04 -07:00 committed by Alexandre Julliard
parent 2de3dc3dd6
commit 221708d64e
1 changed files with 7 additions and 1 deletions

View File

@ -640,14 +640,20 @@ static void get_osx_device_elements(JoystickImpl *device, int axis_map[8])
{
IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( elements, idx );
int type = IOHIDElementGetType( element );
int usage_page = IOHIDElementGetUsagePage( 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)
{
case kIOHIDElementTypeInput_Button:
{
int usage_page = IOHIDElementGetUsagePage( element );
TRACE("kIOHIDElementTypeInput_Button usage_page %d\n", usage_page);
if (usage_page != kHIDPage_Button)
{