summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-23 19:51:38 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-23 19:51:38 +0300
commit533e703a2c394b9c4a0c0e2d7367dd5cc48c1502 (patch)
treebc416027f6fb4d221d04c22ca9c15c11674ca45b /src/client.cpp
parent0d1ecc47f4b30d40474ac9402180f1a690a8eee2 (diff)
downloadmanaplus-533e703a2c394b9c4a0c0e2d7367dd5cc48c1502.tar.gz
manaplus-533e703a2c394b9c4a0c0e2d7367dd5cc48c1502.tar.bz2
manaplus-533e703a2c394b9c4a0c0e2d7367dd5cc48c1502.tar.xz
manaplus-533e703a2c394b9c4a0c0e2d7367dd5cc48c1502.zip
Add support for handling event for show/hide on screen keyboard.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 3a2a5f493..871b5c873 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -115,6 +115,10 @@
#include <cerrno>
#endif
+#ifdef ANDROID
+#include <SDL_screenkeyboard.h>
+#endif
+
#include <sys/stat.h>
#include <iostream>
@@ -685,8 +689,11 @@ void Client::gameInit()
start_time = static_cast<int>(time(nullptr));
- // Initialize PlayerInfo
PlayerInfo::init();
+
+#ifdef ANDROID
+ updateScreenKeyboard(SDL_GetScreenKeyboardHeight(nullptr));
+#endif
}
Client::~Client()
@@ -958,6 +965,9 @@ int Client::gameExec()
inputManager.handleAssignKey(event, INPUT_JOYSTICK);
break;
+ case SDL_MOUSEMOTION:
+ break;
+
#ifdef ANDROID
case SDL_ACTIVEEVENT:
if ((event.active.state & SDL_APPACTIVE)
@@ -967,9 +977,11 @@ int Client::gameExec()
logger->log("exit on lost focus");
}
break;
-#endif
- case SDL_MOUSEMOTION:
+
+ case SDL_KEYBOARDSHOW:
+ updateScreenKeyboard(event.user.code);
break;
+#endif
default:
// logger->log("unknown event: %d", event.type);
@@ -2882,3 +2894,8 @@ void Client::windowRemoved(const Window *const window)
if (instance()->mCurrentDialog == window)
instance()->mCurrentDialog = nullptr;
}
+
+void Client::updateScreenKeyboard(int height)
+{
+// logger->log("keyboard height: %d", height);
+}