diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -1508,7 +1508,7 @@ */ if (event.getKeyCode() == 66) { - String imeHide = SDLActivity.nativeGetHint("SDL_ANDROID_RETURN_HIDES_IME"); + String imeHide = SDLActivity.nativeGetHint("SDL_MOBILE_RETURN_HIDES_IME"); if ((imeHide != null) && imeHide.equals("1")) { Context c = SDL.getContext(); if (c instanceof SDLActivity) { diff --git a/include/SDL_hints.h b/include/SDL_hints.h --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -722,7 +722,7 @@ /** * \brief A variable to control whether the return key on the soft keyboard should hide the - * soft keyboard on Android. + * soft keyboard on Android and iOS. * * The variable can be set to the following values: * "0" - The return key will be handled as a key event. This is the behaviour of @@ -731,7 +731,7 @@ * * The value of this hint is used at runtime, so it can be changed at any time. */ -#define SDL_HINT_ANDROID_RETURN_HIDES_IME "SDL_ANDROID_RETURN_HIDES_IME" +#define SDL_HINT_MOBILE_RETURN_HIDES_IME "SDL_MOBILE_RETURN_HIDES_IME" /** * \brief override the binding element for keyboard inputs for Emscripten builds diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -387,7 +387,9 @@ { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN); SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN); - SDL_StopTextInput(); + if (SDL_GetHintBoolean(SDL_HINT_MOBILE_RETURN_HIDES_IME, SDL_FALSE)) { + SDL_StopTextInput(); + } return YES; }