SDL: fixed SDL_ANDROID_GetScreenKeyboardTextInputAsync() API, build.sh -q will rebuild only armeabi-v7a package

This commit is contained in:
Sergii Pylypenko
2017-01-10 20:47:35 +02:00
parent f3f5378693
commit a826416f74
8 changed files with 33 additions and 8 deletions

View File

@@ -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);