I'm working on a Unity project for Android TV and Fire TV that utilizes the new input system released in v2019.3.
Fire TV's button mappings in the old system were as follows:
Back KeyCode.Escape
Select (D-Pad Center) KeyCode.JoystickButton0
Left (D-Pad) KeyCode.LeftArrow
Right (D-Pad) KeyCode.RightArrow
Up (D-Pad) KeyCode.UpArrow
Down (D-Pad) KeyCode.DownArrow
I've successfully mapped everything but Select/D-Pad Center with the following Binding Paths in the new system:
Escape [Keyboard]
Right Arrow [Keyboard]
Left Arrow [Keyboard]
Up Arrow [Keyboard]
Down Arrow [Keyboard]
If I map to Any Key [Keyboard]
and implement the following code as the callback, it shows up as key: JoystickButton0
, which matches Amazon's documentation, but doesn't exist as an option in the new system under keyboard binding paths:
public void DebugKey(InputAction.CallbackContext context)
{
foreach(KeyCode vKey in System.Enum.GetValues(typeof(KeyCode))){
if(Input.GetKey(vKey)){
Debug.Log ("key: " + vKey);
}
}
}
I've tried various buttons under Gamepad, Android Gamepad, Joystick, and Android Joystick without any success. Another odd thing is that the Center/D-Pad works fine on UI Buttons without any binding.
What is the proper way to map to the legacy KeyCode.JoystickButtonX naming convention with the new input system?
Thanks!