I don’t know if it’s actually a bug but on my Android phone the when I press the back button it triggers the Usages->Back event, but also other events such as Usages->Submit.
Which is pretty annoying because on the main menu the game start when you click back because of the this, and in game the back button is supposed to open the pause menu but the resume button is instantly click by this Submit event.
From my test the following events are fired:
- Usages->PrimaryAction
- Usages->PrimaryTrigger
- Usages->Submit
- Usages->Back
- Usages->Cancel
Action map:
Code:
using UnityEngine;
public class TestInput : MonoBehaviour
{
private void Awake()
{
InputMaster input = new InputMaster();
input.Test.Enable();
input.Test.Back.started += ctx => Debug.Log("Back");
input.Test.Cancel.started += ctx => Debug.Log("Cancel");
input.Test.Forward.started += ctx => Debug.Log("Forward");
input.Test.Menu.started += ctx => Debug.Log("Menu");
input.Test.Modifier.started += ctx => Debug.Log("Modifier");
input.Test.PrimaryAction.started += ctx => Debug.Log("PrimaryAction");
input.Test.PrimaryTrigger.started += ctx => Debug.Log("PrimaryTrigger");
input.Test.SecondaryAction.started += ctx => Debug.Log("SecondaryAction");
input.Test.SecondaryTrigger.started += ctx => Debug.Log("SecondaryTrigger");
input.Test.Submit.started += ctx => Debug.Log("Submit");
}
}
Logs from adb:
03-18 15:23:49.595 17162 706 I Unity : PrimaryAction
03-18 15:23:49.596 17162 706 I Unity : PrimaryTrigger
03-18 15:23:49.597 17162 706 I Unity : Submit
03-18 15:23:49.600 17162 706 I Unity : Back
03-18 15:23:49.600 17162 706 I Unity : Cancel
My phone is a Samsung A50, android 10