TvOS - game control via non-Siri remote

I am working on a game in Objective-C. Remote Siri works fine through GCMicroGamepad, and real MFi controllers work well through GCGamepad. However, third-party IR remote controls do not work at all in the game (as well as non-remote applications on the iPhone or the older Apple TV 3rd gen remote).

How can I recognize and distinguish these inputs?


Two days later ... I found that UITapGestureRecognizer can be used to correctly identify the Up, Down, Left, Right, and Select events when they are represented by a third-party TV remote control or iPhone Remote.app. Directional events are actually unique to these types of remotes, and also - the Siri remote does not generate directional crane events. Unfortunately, however, by pressing the Select button on Siri or a third-party or iPhone Remote.app, you will receive a Select event from my recognizer. I need to somehow distinguish the two.

The only distinguishing factor I can find is that pressing Siri remote also generates pressing the -A button on GCMicroGamepad - a third-party remote control or iPhone Remote.app does not affect GCMicroGamepad at all. But it’s very inconvenient to try to watch GCMicroGamepad for tap-release events, and then use this event to filter the corresponding Select button event. Of course, it is not recommended to use the API; this does not seem like a good long-term solution. If I could tell the remote Siri to stop generating user interface events in GCMicroGamepad mode, that would be great.

+7
objective-c tvos gamepad siri-remote
source share
1 answer

I cannot verify this right now, but you could possibly differentiate Siri Remote from a third-party remote using the GCEventViewController using the controllerUserInteractionEnabled property is false. Thus, Siri Remote inputs should not be transmitted by UIKit (when the GCEventViewController is the first responder). Third-party remote input events can go up to UIKit, because, unlike Siri Remote, it is not GCMicroGamepad.

Until now, Apple really does not support multi-player games with multiple Siri remotes, iOS Remotes or IR remotes. But I think this could happen because the remote iOS application will soon support multi-player games (so I think Apple TV will recognize several GCMicroGamePad controllers).

0
source share

All Articles