aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorlubomyr2017-01-31 22:44:50 +0200
committerlubomyr2017-01-31 22:44:50 +0200
commit9cdda5c045bed4d3a8fe5fc841225f735624e341 (patch)
tree192e4ee9a4f57c7a0e5faeec1b923fdfddf30805 /backends
parent2aa0cdcff67bf423fd7eb5ed8b50749930d32a0f (diff)
downloadscummvm-rg350-9cdda5c045bed4d3a8fe5fc841225f735624e341.tar.gz
scummvm-rg350-9cdda5c045bed4d3a8fe5fc841225f735624e341.tar.bz2
scummvm-rg350-9cdda5c045bed4d3a8fe5fc841225f735624e341.zip
ANDROIDSDL: implemented checkbox for show/hide on-screen control in Options menu
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/androidsdl/androidsdl-sdl.cpp20
-rw-r--r--backends/platform/androidsdl/androidsdl-sdl.h1
2 files changed, 20 insertions, 1 deletions
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index ab0c0524f1..1492214b58 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -28,6 +28,7 @@
#include "backends/events/androidsdl/androidsdl-events.h"
#include "backends/graphics/androidsdl/androidsdl-graphics.h"
#include <SDL_android.h>
+#include <SDL_screenkeyboard.h>
void OSystem_ANDROIDSDL::initBackend() {
// Create the backend custom managers
@@ -50,11 +51,25 @@ void OSystem_ANDROIDSDL::initBackend() {
} else {
touchpadMode(ConfMan.getBool("touchpad_mouse_mode"));
}
+
+ if (!ConfMan.hasKey("onscreen_control")) {
+ const bool enable = (SDL_ANDROID_GetScreenKeyboardShown() == 0) ? false : true;
+ ConfMan.setBool("onscreen_control", enable);
+ } else {
+ showOnScreenControl(ConfMan.getBool("onscreen_control"));
+ }
// Call parent implementation of this method
OSystem_POSIX::initBackend();
}
+void OSystem_ANDROIDSDL::showOnScreenControl(bool enable) {
+ if (enable)
+ SDL_ANDROID_SetScreenKeyboardShown(1);
+ else
+ SDL_ANDROID_SetScreenKeyboardShown(0);
+}
+
void OSystem_ANDROIDSDL::touchpadMode(bool enable) {
if (enable)
switchToRelativeMouseMode();
@@ -72,9 +87,12 @@ void OSystem_ANDROIDSDL::switchToRelativeMouseMode() {
void OSystem_ANDROIDSDL::setFeatureState(Feature f, bool enable) {
switch (f) {
- case kFeatureTouchpadMode:
+ case kFeatureTouchpadMode:
touchpadMode(enable);
break;
+ case kFeatureOnScreenControl:
+ showOnScreenControl(enable);
+ break;
}
OSystem_POSIX::setFeatureState(f, enable);
diff --git a/backends/platform/androidsdl/androidsdl-sdl.h b/backends/platform/androidsdl/androidsdl-sdl.h
index 72d2a50093..7bc91247bc 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.h
+++ b/backends/platform/androidsdl/androidsdl-sdl.h
@@ -32,6 +32,7 @@ public:
void touchpadMode(bool enable);
void switchToDirectMouseMode();
void switchToRelativeMouseMode();
+ void showOnScreenControl(bool enable);
#ifdef ENABLE_KEYMAPPER
// FIXME: This just calls parent methods, is it needed?