My Amazon Fire TV arrived last night, and I am setting up for Unity testing.
Looks like the Fire TV remote is using standard Android media keycodes:
Select (D-Pad Center) KEYCODE_DPAD_CENTER
Play/Pause KEYCODE_MEDIA_PLAY_PAUSE
Rewind KEYCODE_MEDIA_REWIND
Fast Forward KEYCODE_MEDIA_FAST_FORWARD
Is a mapping or plug-in available that routes Android media remote input to Unity KeyCodes or a similar interface?
Also, any mechanisms from Unity to use the Fire TV game controllers? I’ve not implemented controllers in an Android title, so this is outside my area of knowledge. Perhaps they already work under standard Unity game controller mapping.
So far i have been able to get the inputs for Horizontal and Vertical to work. But for the life of me I cant seem to capture the DPAB center or what ever. DOes any one have any ideas?
I have been trying to get the remot working. I got most buttons working correctly. Anyone figure out the media buttons yet? They do not register to any KeyCode value using
foreach (KeyCode k in System.Enum.GetValues(typeof(KeyCode)))
{
if (Input.GetKeyDown(k))
Debug.Log(k.ToString());
}
At the moment our FireTV Remote has the following mappings in Unity3D:
FireTV Button Unity KeyCode
Up Arrow KeyCode.UpArrow
Down Arrow KeyCode.DownArrow
Left Arrow KeyCode.LeftArrow
Right Arrow KeyCode.DownArrow
Center Button KeyCode.JoystickButton0
Back button KeyCode.Escape
Menu Button KeyCode.Menu
The following buttons are not mapped in Unity and would need a plugin developed to accept input:
Play/Pause
Rewind
Fast Forward
The following are system-wide buttons and would not be mapped in 3rd party applications:
Microphone
Home
Thanks for those mappings KevinCodes4Food, I got a test game working great. Do you know how to make it so that the Home button opens the Game Circle menu like the released games do?
We’ve modified a game for the FireTV controls, but now realize that modifying the GUI so the player can tab from one GUI button to another is a bigger task. Are there any brilliantly simple methods for doing that with UnityGUI?
got our game rejected for some few reasons. The game wasn’t taking any inputs from the remote controller to interact in the game ( even if the damn game isn’t meant to played with the remote controller )… Anyways, here I have a few concerns I tried the game and the inputs from the remote controller worked perfectly, then I tried to use the gamepad controller and it wouldn’t work. Seems like once a controller is recognized by the game you can’t use the other. How can we recognized which device is used and / or allow the remote and the controller to be used a the same time?
Also since the game wasn’t taking any inputs from the remote controller maybe they didn’t even try the media buttons… though they worked on the game pad controller… We didn’t have any state regarding media buttons for our game. thanks for giving the info if you know it.
Cheers
We haven’t had any trouble with switching back and forth between the remote and the gamepad.
The Media Buttons are working for you – they’ll pause/play music that’s being played by another app, like Pandora? Those buttons are completely non-functional for us, and we can’t figure out how to enable them. It seems like Unity is blocking their inputs somehow – there’s no way to accept their inputs either, so it’s a catch-22. How did you get them to work?
not sure if I can solve your problem as I’m not doing any of the development. I’m only the artist in the game. But I’m the one having the FIRE TV to test. We use the menu button for our pause menu. the home button works to get to the main fire tv screen and the back button works as well. once I get a hold f my dev, I’ll ask him what he did.
did you do anything special regarding the switching back and forth from remote to gamepad?
We didn’t do anything special for the remote and gamepad – that, at least, is something that “just works.” Odd that it doesn’t for you.
We’ve got the back/menu buttons working; it’s the play/pause buttons below those on the remote which are the problem. They are disabled when our game is running, and Amazon rejects the app because of that.
Whoops, sorry for the misunderstanding on my end. Well we’re not using these at all. Our game got rejected because of some other stuff but not that. That’s weird. Didn’t know it was a requirement to have those inputs taken care of …
For your issue switching between remote and controller, check how the controls are coded. If you specify something like “joystick0button0” instead of “joystickbutton0” it will only respond to the first controller (either controller or remote depending which was connected first).
Test: Press the Fast Forward, Play/Pause, and Rewind buttons.
Expected Results: In media playback, the media buttons behave as expected. In non-media apps, the media buttons should not be used for some other function, as this may interfere with the system’s ability to control media playing in the background. Note that If your app uses a framework such as Unity, you may ignore this requirement , as the ability to pass key events through to the system is not supported in those frameworks.