Android: Fix back button sometimes not working as ESC #14743
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old
CIrrDeviceAndroid
mapped the Android back button toKEY_CANCEL
, so the initial Android port (1cc40c0) included code to treatKEY_CANCEL
likeKEY_ESCAPE
. Having to handle two different keys for the same purpose is obviously annoying, but it also causes bugs because it isn't done consistenly. For example, the key change dialog doesn't react toKEY_CANCEL
and list boxes and text fields breakKEY_CANCEL
by absorbing it in some cases.This PR maps the Android back button to
KEY_ESCAPE
instead and removes special handling forKEY_CANCEL
.EDIT: Actually, it looks like using
KEY_CANCEL
was a MT patch and Irrlicht originally usedKEY_BACK
/backspace.To do
This PR is a Ready for Review.
How to test
Verify that the Android back button works as ESC, also in the mentioned cases where it didn't work before.