Android patches

This commit is contained in:
pelya
2014-03-15 19:44:27 +02:00
parent f177e48d88
commit 6dc8be0332
14 changed files with 97 additions and 19 deletions
+13
View File
@@ -22,6 +22,9 @@
#include "table/sprites.h"
#include "table/strings.h"
#ifdef __ANDROID__
#include <SDL_screenkeyboard.h>
#endif
char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1];
static WChar _keyboard[2][OSK_KEYBOARD_ENTRIES];
@@ -413,6 +416,16 @@ void ShowOnScreenKeyboard(Window *parent, int button)
GetKeyboardLayout();
new OskWindow(&_osk_desc, parent, button);
#ifdef __ANDROID__
char text[256];
SDL_ANDROID_GetScreenKeyboardTextInput(text, sizeof(text) - 1); /* Invoke Android built-in screen keyboard */
OskWindow *osk = dynamic_cast<OskWindow *>(FindWindowById(WC_OSK, 0));
osk->qs->text.Assign(text);
free(osk->orig_str_buf);
osk->orig_str_buf = strdup(osk->qs->text.buf);
osk->SetDirty();
#endif
}
/**