- Home /
New input system - getting back button press on mobile
I am using the new input system and the back button does not appear to be bound on Android.
In the old input system the back button could be got by responding to the Escape key. This does not appear to work with the new system.
Is there a different API call for this now? Or has it not yet been developed?
Answer by zvobrandir · Jun 11, 2020 at 09:53 AM
If u looking for InputActions binding path u can find it an "Usages" section.
In code for mobile's back button still working access to "escape" key. So in new API something like:
private void Update()
{
if (UnityEngine.InputSystem.Keyboard.current.escapeKey.wasPressedThisFrame)
{
// Do something
}
}
U can find more about migrating here.
Thanks for answering - I have moved back to the old input system for now - it works fine and I am getting close to releasing my game, so don't really have scope to check whether this works. Previously this is exactly what I was doing, maybe they fixed it in a recent update if it works for you.
That's a shame. The new input system should be a no brainer :(
I presume it is sorted now. I can't imagine after all this time it is still an issue.
This code does not work on preview.5. Due to this lack of the feature and other issues we had to opt for using both input systems. Right now I can not test it on final 1.0.0 (new issues in that version prevented us to update), so maybe is solved in that version, idk.
I tested it on my android device (for InputSystem v1.0.0) and it works for me.
Answer by silva_raptor · Mar 18, 2020 at 12:42 PM
There is no word about this issue in the Input System documentation. It should be implemented in the API or properly documented.