Emulated GCGameController not working with non fullscreen Designed for iPad apps on MacBook

Hello,

I have an iPad app that users are running on their M1 / M2 MacBooks thanks to the "Designed for iPad" feature. Some of them reported to me that the pressed keyboard keys were not recognized. According to my source code, it seems that my custom views (that are set as firstResponder) do not get pressesBegan events.

While I could not reproduce this specific problem on my M1 Macbook, I found a strange problem that may be related. My view also supports interaction with game controllers. I found that the emulated controller (which is using the keyboard, when the controller emulation feature of the Designed for iPad app is set to On) has some problems.

The valueChangedHandler of the GCExtendedGamepad from the GCGameController is only fired if the app is compiled with the "Requires full screen" option set to On. If Requires full screen is unchecked in XCode, the Emulated Controller is still present in the list of game controllers, but no button callbacks are triggered. Note that a real game controller connected via USB will work correctly no matter how Requires full screen is set.

Could there be a focus bug of the keyboard not sending events when the app is not a full screen app (resizable on mac, and multitask on iPad)? Or is there something I can change to avoid this problem?

I'm lost.

Emulated GCGameController not working with non fullscreen Designed for iPad apps on MacBook
 
 
Q