diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-30 23:24:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-30 23:24:09 +0300 |
commit | 021e567ba44650b0ab63e7f571dc0d622edbcc6d (patch) | |
tree | 32845a9e5b32f799bc8bbe5c25a1cd83892b104b /src | |
parent | bb0b49f4d70f8268550068f972549ffa33e9a75b (diff) | |
download | manaplus-021e567ba44650b0ab63e7f571dc0d622edbcc6d.tar.gz manaplus-021e567ba44650b0ab63e7f571dc0d622edbcc6d.tar.bz2 manaplus-021e567ba44650b0ab63e7f571dc0d622edbcc6d.tar.xz manaplus-021e567ba44650b0ab63e7f571dc0d622edbcc6d.zip |
Add action to show onscreen keyboard.
Diffstat (limited to 'src')
-rw-r--r-- | src/actionmanager.cpp | 11 | ||||
-rw-r--r-- | src/actionmanager.h | 1 | ||||
-rw-r--r-- | src/gui/setupactiondata.h | 5 | ||||
-rw-r--r-- | src/keyboarddata.h | 7 | ||||
-rw-r--r-- | src/keydata.h | 1 | ||||
-rw-r--r-- | src/touchactions.cpp | 8 |
6 files changed, 26 insertions, 7 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index 92087b6db..761825f03 100644 --- a/src/actionmanager.cpp +++ b/src/actionmanager.cpp @@ -65,6 +65,10 @@ #include <guichan/actionlistener.hpp> +#ifdef ANDROID +#include <SDL_screenkeyboard.h> +#endif + #include "debug.h" #define impHandler(name) bool name(const InputEvent &event) @@ -1065,4 +1069,11 @@ impHandler0(stopSit) return false; } +impHandler0(showKeyboard) +{ +#ifdef ANDROID + SDL_ANDROID_ToggleScreenKeyboardTextInput(nullptr); +#endif +} + } diff --git a/src/actionmanager.h b/src/actionmanager.h index 380a156c7..3db7e4a99 100644 --- a/src/actionmanager.h +++ b/src/actionmanager.h @@ -95,6 +95,7 @@ namespace ActionManager decHandler(targetNPC); decHandler(safeVideoMode); decHandler(stopSit); + decHandler(showKeyboard); decHandler(hideWindows); decHandler(helpWindowShow); diff --git a/src/gui/setupactiondata.h b/src/gui/setupactiondata.h index 2ca6aaa3c..935cd95b6 100644 --- a/src/gui/setupactiondata.h +++ b/src/gui/setupactiondata.h @@ -1154,6 +1154,11 @@ static SetupActionData setupActionData6[] = "", }, { + N_("Show onscreen keyboard"), + Input::KEY_SHOW_KEYBOARD, + "", + }, + { "", Input::KEY_NO_VALUE, "" diff --git a/src/keyboarddata.h b/src/keyboarddata.h index 506594d7a..0d40454fb 100644 --- a/src/keyboarddata.h +++ b/src/keyboarddata.h @@ -1929,6 +1929,13 @@ static const KeyData keyData[Input::KEY_TOTAL] = { Input::GRP_DEFAULT, &ActionManager::stopSit, Input::KEY_NO_VALUE, 50, + COND_DEFAULT}, + {"keyShowKeyboard", + INPUT_UNKNOWN, Input::KEY_NO_VALUE, + INPUT_UNKNOWN, Input::KEY_NO_VALUE, + Input::GRP_DEFAULT, + &ActionManager::showKeyboard, + Input::KEY_NO_VALUE, 50, COND_DEFAULT} }; diff --git a/src/keydata.h b/src/keydata.h index 5d3606d69..c328178a7 100644 --- a/src/keydata.h +++ b/src/keydata.h @@ -338,6 +338,7 @@ namespace Input KEY_GUI_MOD, KEY_SAFE_VIDEO, KEY_STOP_SIT, + KEY_SHOW_KEYBOARD, KEY_TOTAL }; } diff --git a/src/touchactions.cpp b/src/touchactions.cpp index 2a6fbacaa..d45e4a7c3 100644 --- a/src/touchactions.cpp +++ b/src/touchactions.cpp @@ -26,10 +26,6 @@ #include "mouseinput.h" #include "touchmanager.h" -#ifdef ANDROID -#include <SDL_screenkeyboard.h> -#endif - #include "debug.h" InputEvent tempEvent(0, 0); @@ -41,9 +37,7 @@ int haldJoyPad = 50; impHandler0(showKeyboard) { -#ifdef ANDROID - SDL_ANDROID_ToggleScreenKeyboardTextInput(nullptr); -#endif + ActionManager::showKeyboard(tempEvent); } void setHalfJoyPad(int s) |