From 0ea927ecb58022eb7540c022fe81920447095f50 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Thu, 27 Mar 2014 21:11:08 +0200 Subject: [PATCH] Allow clearing input field in Android native text input --- project/jni/sdl-1.2/src/video/android/SDL_androidinput.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidinput.c b/project/jni/sdl-1.2/src/video/android/SDL_androidinput.c index b301ad8ef..2fe9ee593 100644 --- a/project/jni/sdl-1.2/src/video/android/SDL_androidinput.c +++ b/project/jni/sdl-1.2/src/video/android/SDL_androidinput.c @@ -896,6 +896,8 @@ JAVA_EXPORT_NAME(DemoRenderer_nativeTextInput) ( JNIEnv* env, jobject thiz, jin JNIEXPORT void JNICALL JAVA_EXPORT_NAME(DemoRenderer_nativeTextInputFinished) ( JNIEnv* env, jobject thiz ) { + if (textInputBufferPos == 0 && textInputBuffer) // No text input - clear buffer + textInputBuffer[0] = 0; textInputBuffer = NULL; SDL_ANDROID_TextInputFinished = 1; }