diff --git a/project/jni/application/ballfield/ballfield.cpp b/project/jni/application/ballfield/ballfield.cpp index b89a87a0c..0bbca5c79 100644 --- a/project/jni/application/ballfield/ballfield.cpp +++ b/project/jni/application/ballfield/ballfield.cpp @@ -594,6 +594,9 @@ int main(int argc, char* argv[]) fps = (float)fps_count * 1000.0 / (tick - fps_start); fps_count = 0; fps_start = tick; + static int fj = false; + fj=!fj; + SDL_ANDROID_SetScreenKeyboardFloatingJoystick(fj); } print_num(screen, font, screen->w-37, screen->h-12, fps); diff --git a/project/jni/sdl-1.2/include/SDL_screenkeyboard.h b/project/jni/sdl-1.2/include/SDL_screenkeyboard.h index 4af9ccb34..639efc02c 100644 --- a/project/jni/sdl-1.2/include/SDL_screenkeyboard.h +++ b/project/jni/sdl-1.2/include/SDL_screenkeyboard.h @@ -103,6 +103,10 @@ extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardButtonGenerateTouchEven /* Configure a button to stay pressed after touch, and un-press after second touch, to emulate Ctrl/Alt/Shift keys */ extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardButtonStayPressedAfterTouch(int buttonId, int stayPressed); +/* Enable or disable floating joystick, the joystick is hidden after you disable floating joystick, + you should set it's coordinates with SDL_ANDROID_SetScreenKeyboardButtonPos(). */ +extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardFloatingJoystick(int enabled); + /* Set screen keyboard transparency, 255 or SDL_ALPHA_OPAQUE is non-transparent, 0 or SDL_ALPHA_TRANSPARENT is transparent */ extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardTransparency(int alpha); 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 0ae6e77b5..4906d3b7e 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 @@ -1191,6 +1191,14 @@ int SDL_ANDROID_SetScreenKeyboardHintMesage(const char * hint) return 1; } +extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardFloatingJoystick(int enabled) +{ + floatingScreenJoystick = enabled; + SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_DPAD, 0); + return 1; +} + + /** * @brief Dumps OpenGL state for debugging - typically every capability set with glEnable(). */