Skip to content

Commit fdb2838

Browse files
authored
mfi: try harder to own the home button (#18374)
1 parent 95680d8 commit fdb2838

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

input/drivers_joypad/mfi_joypad.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,20 @@ static void apple_gamecontroller_joypad_register(GCController *controller)
238238
gp.buttonOptions.preferredSystemGestureState = GCSystemGestureStateDisabled;
239239
gp.buttonMenu.preferredSystemGestureState = GCSystemGestureStateDisabled;
240240
gp.buttonHome.preferredSystemGestureState = GCSystemGestureStateDisabled;
241+
242+
GCPhysicalInputProfile *profile = controller.physicalInputProfile;
243+
GCControllerButtonInput *homeBtn = (GCControllerButtonInput *)profile.buttons[GCInputButtonHome];
244+
if (homeBtn) {
245+
homeBtn.preferredSystemGestureState = GCSystemGestureStateDisabled;
246+
}
247+
GCControllerButtonInput *menuBtn = (GCControllerButtonInput *)profile.buttons[GCInputButtonMenu];
248+
if (menuBtn) {
249+
menuBtn.preferredSystemGestureState = GCSystemGestureStateDisabled;
250+
}
251+
GCControllerButtonInput *optionsBtn = (GCControllerButtonInput *)profile.buttons[GCInputButtonOptions];
252+
if (optionsBtn) {
253+
optionsBtn.preferredSystemGestureState = GCSystemGestureStateDisabled;
254+
}
241255
}
242256
#endif
243257

0 commit comments

Comments
 (0)