From 51ca41dd9fdf98bc9d38810f84ad4cb218ecd88a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 31 Jan 2019 00:44:10 +0100 Subject: [PATCH] Cocoa: Add missing IOHID page and usages Related to #1385. --- README.md | 1 + src/cocoa_joystick.m | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d818ac3..b361ae3f 100644 --- a/README.md +++ b/README.md @@ -288,6 +288,7 @@ information on what to include when reporting a bug. - [Cocoa] Bugfix: OpenGL rendering was not initially visible on 10.14 (#1334,#1346) - [Cocoa] Bugfix: Caps Lock did not generate any key events (#1368,#1373) +- [Cocoa] Bugfix: Some buttons for some joysticks were ignored (#1385) - [WGL] Added support for `WGL_EXT_colorspace` for OpenGL ES contexts - [WGL] Added support for `WGL_ARB_create_context_no_error` - [GLX] Added support for `GLX_ARB_create_context_no_error` diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index 0831809f..2d1522e6 100644 --- a/src/cocoa_joystick.m +++ b/src/cocoa_joystick.m @@ -220,9 +220,18 @@ static void matchCallback(void* context, case kHIDUsage_GD_Hatswitch: target = hats; break; + case kHIDUsage_GD_DPadUp: + case kHIDUsage_GD_DPadRight: + case kHIDUsage_GD_DPadDown: + case kHIDUsage_GD_DPadLeft: + case kHIDUsage_GD_SystemMainMenu: + case kHIDUsage_GD_Select: + case kHIDUsage_GD_Start: + target = buttons; + break; } } - else if (page == kHIDPage_Button) + else if (page == kHIDPage_Button || page == kHIDPage_Consumer) target = buttons; if (target)