diff --git a/build.sh b/build.sh index c88e8292e..eb899092f 100755 --- a/build.sh +++ b/build.sh @@ -6,6 +6,7 @@ run_apk=false sign_apk=false build_release=true quick_rebuild=false +QUICK_REBUILD_ARGS= if [ "$#" -gt 0 -a "$1" = "-s" ]; then shift @@ -26,6 +27,7 @@ fi if [ "$#" -gt 0 -a "$1" = "-q" ]; then shift quick_rebuild=true + QUICK_REBUILD_ARGS=APP_ABI=armeabi-v7a fi if [ "$#" -gt 0 -a "$1" = "release" ]; then @@ -169,7 +171,7 @@ strip_libs() { return 0 } -cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j$NCPU V=1 && \ +cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j$NCPU V=1 $QUICK_REBUILD_ARGS && \ strip_libs && \ cd .. && ./copyAssets.sh && cd project && \ { if $build_release ; then \ diff --git a/project/java/MainActivity.java b/project/java/MainActivity.java index 8fd8caacc..084f9d7e2 100644 --- a/project/java/MainActivity.java +++ b/project/java/MainActivity.java @@ -791,6 +791,7 @@ public class MainActivity extends Activity public void showScreenKeyboard(final String oldText) { + Log.i("SDL", "showScreenKeyboard()"); if(Globals.CompatibilityHacksTextInputEmulatesHwKeyboard) { showScreenKeyboardWithoutTextInputField(Globals.TextInputKeyboard); @@ -798,6 +799,7 @@ public class MainActivity extends Activity } if(_screenKeyboard != null) return; + Log.i("SDL", "showScreenKeyboard() - adding keyboard view"); class simpleKeyListener implements OnKeyListener { MainActivity _parent; @@ -817,6 +819,7 @@ public class MainActivity extends Activity keyCode == KeyEvent.KEYCODE_BUTTON_3 || keyCode == KeyEvent.KEYCODE_BUTTON_4 )) { + Log.i("SDL", "_parent.hideScreenKeyboard()"); _parent.hideScreenKeyboard(); return true; } @@ -904,6 +907,7 @@ public class MainActivity extends Activity public void hideScreenKeyboard() { + Log.i("SDL", "hideScreenKeyboard()"); if( keyboardWithoutTextInputShown ) showScreenKeyboardWithoutTextInputField(Globals.TextInputKeyboard); @@ -918,6 +922,7 @@ public class MainActivity extends Activity DemoRenderer.nativeTextInput( (int)text.charAt(i), (int)text.codePointAt(i) ); } } + Log.i("SDL", "hideScreenKeyboard() nativeTextInputFinished()"); DemoRenderer.nativeTextInputFinished(); _inputManager.hideSoftInputFromWindow(_screenKeyboard.getWindowToken(), 0); _videoLayout.removeView(_screenKeyboard); diff --git a/project/jni/SettingsTemplate.mk b/project/jni/SettingsTemplate.mk index 6d19a5ebd..7da3aaa1b 100644 --- a/project/jni/SettingsTemplate.mk +++ b/project/jni/SettingsTemplate.mk @@ -5,7 +5,9 @@ APP_MODULES := application sdl-1.2 sdl_main sdl_native_helpers jpeg png ogg flac # To filter out static libs from all libs in makefile APP_AVAILABLE_STATIC_LIBS := jpeg png tremor freetype xerces ogg tremor vorbis flac boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread boost_locale glu icudata icutest icui18n icuio icule iculx icutu icuuc sdl_savepng android_support gl4es nanogl +ifeq ($(APP_ABI),) APP_ABI := armeabi +endif # The namespace in Java file, with dots replaced with underscores SDL_JAVA_PACKAGE_PATH := net_sourceforge_clonekeenplus diff --git a/project/jni/application/ballfield/ballfield.cpp b/project/jni/application/ballfield/ballfield.cpp index a32122265..9735ee168 100644 --- a/project/jni/application/ballfield/ballfield.cpp +++ b/project/jni/application/ballfield/ballfield.cpp @@ -442,6 +442,8 @@ int main(int argc, char* argv[]) int accel[5], screenjoy[4], gamepads[4][8]; SDL_Surface *mouse[4]; int screenKeyboardShown = 0; + int asyncTextInput = 0; + char asyncTextInputBuf[256]; SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK); @@ -694,8 +696,10 @@ int main(int argc, char* argv[]) } if(evt.key.keysym.sym == SDLK_2) { - SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_DPAD, 1); - screen = SDL_SetVideoMode(SCREEN_W, SDL_GetVideoSurface()->h + 1, bpp, flags); + __android_log_print(ANDROID_LOG_INFO, "Ballfield", "Async text input started"); + asyncTextInput = 1; + asyncTextInputBuf[0] = 0; + SDL_ANDROID_GetScreenKeyboardTextInputAsync(asyncTextInputBuf, sizeof(asyncTextInputBuf)); } if(evt.key.keysym.sym == SDLK_3) SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_DPAD, 0); @@ -752,6 +756,14 @@ int main(int argc, char* argv[]) __android_log_print(ANDROID_LOG_INFO, "Ballfield", "Screen keyboard shown: %d -> %d", screenKeyboardShown, SDL_IsScreenKeyboardShown(NULL)); screenKeyboardShown = SDL_IsScreenKeyboardShown(NULL); } + if( asyncTextInput ) + { + if( SDL_ANDROID_GetScreenKeyboardTextInputAsync(asyncTextInputBuf, sizeof(asyncTextInputBuf)) == SDL_ANDROID_TEXTINPUT_ASYNC_FINISHED) + { + __android_log_print(ANDROID_LOG_INFO, "Ballfield", "Async text input: %s", asyncTextInputBuf); + asyncTextInput = 0; + } + } /* Animate */ x_speed = 500.0 * sin(t * 0.37); diff --git a/project/jni/application/ninslash/src b/project/jni/application/ninslash/src index f905c1952..02170840f 160000 --- a/project/jni/application/ninslash/src +++ b/project/jni/application/ninslash/src @@ -1 +1 @@ -Subproject commit f905c1952109ed37ecae756a0eef74cd09c8a95a +Subproject commit 02170840f63db3ecc1add0f9fdf568dbc5f5c47c diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-compat.c b/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-compat.c index fd9ee5f1c..9a6a86f70 100644 --- a/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-compat.c +++ b/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-compat.c @@ -523,7 +523,6 @@ void SDL_ANDROID_DeferredTextInput() { if( SDL_ANDROID_TextInputFinished ) { - SDL_ANDROID_TextInputFinished = 0; SDL_ANDROID_IsScreenKeyboardShownFlag = 0; } } diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-fast.c b/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-fast.c index 974640cd5..cb2ce4376 100644 --- a/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-fast.c +++ b/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-fast.c @@ -306,7 +306,6 @@ void SDL_ANDROID_DeferredTextInput() { if( SDL_ANDROID_TextInputFinished ) { - SDL_ANDROID_TextInputFinished = 0; SDL_ANDROID_IsScreenKeyboardShownFlag = 0; } } diff --git a/project/jni/sdl-1.2/src/video/android/SDL_touchscreenkeyboard.c b/project/jni/sdl-1.2/src/video/android/SDL_touchscreenkeyboard.c index fb9f509cb..e3e9d75b8 100644 --- a/project/jni/sdl-1.2/src/video/android/SDL_touchscreenkeyboard.c +++ b/project/jni/sdl-1.2/src/video/android/SDL_touchscreenkeyboard.c @@ -96,6 +96,8 @@ static int themeType = 0; static int joystickTouchPoints[MAX_JOYSTICKS*2]; static int floatingScreenJoystick = 0; +static int asyncTextInputActive = 0; + static void R_DumpOpenGlState(void); static inline int InsideRect(const SDL_Rect * r, int x, int y) @@ -1247,10 +1249,14 @@ SDL_AndroidTextInputAsyncStatus_t SDLCALL SDL_ANDROID_GetScreenKeyboardTextInput if( SDL_ANDROID_TextInputFinished ) { SDL_ANDROID_TextInputFinished = 0; - SDL_ANDROID_IsScreenKeyboardShownFlag = 0; + asyncTextInputActive = 0; return SDL_ANDROID_TEXTINPUT_ASYNC_FINISHED; } - SDL_ANDROID_CallJavaShowScreenKeyboard(textBuf, textBuf, textBufSize, 1); + if( !SDL_ANDROID_IsScreenKeyboardShownFlag && !asyncTextInputActive ) + { + asyncTextInputActive = 1; + SDL_ANDROID_CallJavaShowScreenKeyboard(textBuf, textBuf, textBufSize, 1); + } return SDL_ANDROID_TEXTINPUT_ASYNC_IN_PROGRESS; }