Android: the Submit event is fired when you press the back button

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

1 Like

Same here, OnePluse 6T, android 11. It looks like unity conside Return to submit.

I can report the same error on Asus Zenfone 8 (Android 11) and Google Pixel 5 (Android 12) and the Nvidia Shield Pro 2019 (Android 9) using the back button on the remote control.
I found out that also the cancel event is fired on the Joystick Trigger without a started event.

Same issue on my Poco X3 Pro. Took me an hour to find this weird behaviour, yuck Unity.

In my case, I was able to fix this by editing the “Submit” action in DefaultInputActions that EventSystem uses as follows: