(Android) Fixed an issue where pressing the backspace key twice while editing text using a physical keyboard would close the text input dialog

This commit is contained in:
Leon Styhre 2024-02-26 18:03:47 +01:00
parent 9d1522bec5
commit d806e9376d

View file

@ -10,6 +10,10 @@
#include "utils/StringUtil.h" #include "utils/StringUtil.h"
#if defined(__ANDROID__)
#include "Settings.h"
#endif
#define TEXT_PADDING_HORIZ 12.0f #define TEXT_PADDING_HORIZ 12.0f
#define TEXT_PADDING_VERT 2.0f #define TEXT_PADDING_VERT 2.0f
@ -205,13 +209,21 @@ bool TextEditComponent::input(InputConfig* config, Input input)
} }
return true; return true;
} }
#if !defined(__ANDROID__) #if defined(__ANDROID__)
else if (!Settings::getInstance()->getBool("VirtualKeyboard") &&
input.id == SDLK_BACKSPACE) {
return false;
}
else if (Settings::getInstance()->getBool("VirtualKeyboard") &&
input.id == SDLK_BACKSPACE) {
mMaskInput = false;
#else
else if (input.id == SDLK_BACKSPACE) { else if (input.id == SDLK_BACKSPACE) {
mMaskInput = false; mMaskInput = false;
textInput("\b"); textInput("\b");
#endif
return true; return true;
} }
#endif
} }
if (cursorLeft || cursorRight) { if (cursorLeft || cursorRight) {