From d26d6e9d44f89a68951dd1d16d5d517d09d2352a Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Thu, 27 Mar 2014 21:33:59 +0200 Subject: [PATCH] Reset mouse buttons before entering text input mode, to prevent launching text input in the loop in grafx2 --- project/jni/sdl-1.2/src/video/android/SDL_androidvideo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.c b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.c index 4f79c3310..ac356974b 100644 --- a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.c +++ b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.c @@ -237,6 +237,11 @@ extern SDL_Surface *SDL_GetVideoSurface(void); void SDL_ANDROID_CallJavaShowScreenKeyboard(const char * oldText, char * outBuf, int outBufLen) { + // Clear mouse button state, to avoid repeated clicks on the text field in some apps + SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_LEFT ); + SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_RIGHT ); + SDL_ANDROID_MainThreadPushMouseButton( SDL_RELEASED, SDL_BUTTON_MIDDLE ); + SDL_ANDROID_TextInputFinished = 0; SDL_ANDROID_IsScreenKeyboardShownFlag = 1; if( !outBuf )