mirror of
https://github.com/celisej567/mcpe.git
synced 2025-12-31 17:49:17 +03:00
Fix Text Auto-Complete On Android
This commit is contained in:
committed by
iProgramInCpp
parent
d4a100825b
commit
20790755d1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user