Mac: Detect the d-pad and pause buttons on Steelseries MFi gamepads (bug #3124.)

This commit is contained in:
Alex Szpakowski 2015-11-12 22:44:32 -04:00
parent 7267835842
commit 9c51c4a639
2 changed files with 17 additions and 0 deletions

View File

@ -243,6 +243,18 @@ AddHIDElement(const void *value, void *parameter)
} }
} }
break; break;
case kHIDUsage_GD_DPadUp:
case kHIDUsage_GD_DPadDown:
case kHIDUsage_GD_DPadRight:
case kHIDUsage_GD_DPadLeft:
if (!ElementAlreadyAdded(cookie, pDevice->firstButton)) {
element = (recElement *) SDL_calloc(1, sizeof (recElement));
if (element) {
pDevice->buttons++;
headElement = &(pDevice->firstButton);
}
}
break;
} }
break; break;
@ -265,6 +277,7 @@ AddHIDElement(const void *value, void *parameter)
break; break;
case kHIDPage_Button: case kHIDPage_Button:
case kHIDPage_Consumer: /* e.g. 'pause' button on Steelseries MFi gamepads. */
if (!ElementAlreadyAdded(cookie, pDevice->firstButton)) { if (!ElementAlreadyAdded(cookie, pDevice->firstButton)) {
element = (recElement *) SDL_calloc(1, sizeof (recElement)); element = (recElement *) SDL_calloc(1, sizeof (recElement));
if (element) { if (element) {

View File

@ -317,6 +317,10 @@ UIKit_DestroyWindow(_THIS, SDL_Window * window)
[view setSDLWindow:NULL]; [view setSDLWindow:NULL];
} }
/* iOS may still hold a reference to the window after we release it.
* We want to make sure the SDL view controller isn't accessed in
* that case, because it would contain an invalid pointer to the old
* SDL window. */
data.uiwindow.rootViewController = nil; data.uiwindow.rootViewController = nil;
data.uiwindow.hidden = YES; data.uiwindow.hidden = YES;
} }