mirror of
https://github.com/minetest/minetest.git
synced 2025-07-04 17:00:23 +02:00
Android: Fix back button sometimes not working as ESC (#14743)
This commit is contained in:
@ -4105,7 +4105,7 @@ bool GUIFormSpecMenu::preprocessEvent(const SEvent& event)
|
||||
// Fix Esc/Return key being eaten by checkboxen and tables
|
||||
if (event.EventType == EET_KEY_INPUT_EVENT) {
|
||||
KeyPress kp(event.KeyInput);
|
||||
if (kp == EscapeKey || kp == CancelKey
|
||||
if (kp == EscapeKey
|
||||
|| kp == getKeySetting("keymap_inventory")
|
||||
|| event.KeyInput.Key==KEY_RETURN) {
|
||||
gui::IGUIElement *focused = Environment->getFocus();
|
||||
@ -4173,7 +4173,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
||||
if (event.EventType==EET_KEY_INPUT_EVENT) {
|
||||
KeyPress kp(event.KeyInput);
|
||||
if (event.KeyInput.PressedDown && (
|
||||
(kp == EscapeKey) || (kp == CancelKey) ||
|
||||
(kp == EscapeKey) ||
|
||||
((m_client != NULL) && (kp == getKeySetting("keymap_inventory"))))) {
|
||||
tryClose();
|
||||
return true;
|
||||
|
@ -160,9 +160,7 @@ void GUIOpenURLMenu::drawMenu()
|
||||
bool GUIOpenURLMenu::OnEvent(const SEvent &event)
|
||||
{
|
||||
if (event.EventType == EET_KEY_INPUT_EVENT) {
|
||||
if ((event.KeyInput.Key == KEY_ESCAPE ||
|
||||
event.KeyInput.Key == KEY_CANCEL) &&
|
||||
event.KeyInput.PressedDown) {
|
||||
if (event.KeyInput.Key == KEY_ESCAPE && event.KeyInput.PressedDown) {
|
||||
quitMenu();
|
||||
return true;
|
||||
}
|
||||
|
@ -187,9 +187,7 @@ bool GUIPasswordChange::processInput()
|
||||
bool GUIPasswordChange::OnEvent(const SEvent &event)
|
||||
{
|
||||
if (event.EventType == EET_KEY_INPUT_EVENT) {
|
||||
if ((event.KeyInput.Key == KEY_ESCAPE ||
|
||||
event.KeyInput.Key == KEY_CANCEL) &&
|
||||
event.KeyInput.PressedDown) {
|
||||
if (event.KeyInput.Key == KEY_ESCAPE && event.KeyInput.PressedDown) {
|
||||
quitMenu();
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user