diff --git a/src/render/gui/imgui/imgui_impl_sdl.cpp b/src/render/gui/imgui/imgui_impl_sdl.cpp index e0e6ddb..b4b44de 100644 --- a/src/render/gui/imgui/imgui_impl_sdl.cpp +++ b/src/render/gui/imgui/imgui_impl_sdl.cpp @@ -141,6 +141,11 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event) case SDL_KEYUP: { int key = event->key.keysym.scancode; + if (key == SDLK_BACKSPACE) { + io.KeysDown[key] = true; + } else { + io.KeysDown[key] = (event->type == SDL_KEYDOWN); + } IM_ASSERT(key >= 0 && key < IM_ARRAYSIZE(io.KeysDown)); io.KeysDown[key] = (event->type == SDL_KEYDOWN); io.KeyShift = ((SDL_GetModState() & KMOD_SHIFT) != 0); @@ -162,6 +167,18 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event) return true; } } +// activating screen keyboard for Android devices +#ifdef __ANDROID__ + static bool keyboardShown = false; + if(ImGui::GetIO().WantTextInput != keyboardShown){ + if(ImGui::GetIO().WantTextInput){ + SDL_StartTextInput(); + }else{ + SDL_StopTextInput(); + } + keyboardShown = ImGui::GetIO().WantTextInput; + } +#endif return false; }