Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Fix back button sometimes not working as ESC #14743

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

grorp
Copy link
Member

@grorp grorp commented Jun 10, 2024

The old CIrrDeviceAndroid mapped the Android back button to KEY_CANCEL, so the initial Android port (1cc40c0) included code to treat KEY_CANCEL like KEY_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 to KEY_CANCEL and list boxes and text fields break KEY_CANCEL by absorbing it in some cases.

This PR maps the Android back button to KEY_ESCAPE instead and removes special handling for KEY_CANCEL.

EDIT: Actually, it looks like using KEY_CANCEL was a MT patch and Irrlicht originally used KEY_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.

Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not tested but code lgtm

@grorp grorp merged commit 85878d8 into minetest:master Jun 11, 2024
13 checks passed
@grorp grorp deleted the back-button-esc branch June 11, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants