mirror of
https://github.com/ReMinecraftPE/mcpe.git
synced 2025-01-22 17:23:32 -05:00
Fix Text Auto-Complete On Android
This commit is contained in:
parent
d4a100825b
commit
20790755d1
2 changed files with 13 additions and 8 deletions
|
@ -138,6 +138,12 @@ static void handle_events()
|
|||
break;
|
||||
}
|
||||
|
||||
// Text Editing
|
||||
if (event.key.keysym.sym == SDLK_BACKSPACE && event.key.state == SDL_PRESSED)
|
||||
{
|
||||
g_pApp->handleCharInput('\b');
|
||||
}
|
||||
|
||||
// Normal Key Press
|
||||
Keyboard::feed(AppPlatform_sdl_base::GetKeyState(event), TranslateSDLKeyCodeToVirtual(event.key.keysym.sym));
|
||||
if (event.key.keysym.sym == SDLK_LSHIFT || event.key.keysym.sym == SDLK_RSHIFT)
|
||||
|
@ -191,10 +197,14 @@ static void handle_events()
|
|||
{
|
||||
if (g_pApp != nullptr)
|
||||
{
|
||||
char x = event.text.text[0];
|
||||
if (x >= ' ' && x <= '~')
|
||||
size_t length = strlen(event.text.text);
|
||||
for (size_t i = 0; i < length; i++)
|
||||
{
|
||||
g_pApp->handleCharInput(x);
|
||||
char x = event.text.text[i];
|
||||
if (x >= ' ' && x <= '~')
|
||||
{
|
||||
g_pApp->handleCharInput(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -144,11 +144,6 @@ void TextInputBox::keyPressed(Minecraft* minecraft, int key)
|
|||
case AKEYCODE_ARROW_RIGHT:
|
||||
chr = '\003';
|
||||
break;
|
||||
#ifdef USE_SDL
|
||||
case AKEYCODE_DEL:
|
||||
chr = '\b';
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue