diff --git a/project/jni/guichan/include/guichan/widgets/textfield.hpp b/project/jni/guichan/include/guichan/widgets/textfield.hpp index 486660a8a..27fffa2b6 100755 --- a/project/jni/guichan/include/guichan/widgets/textfield.hpp +++ b/project/jni/guichan/include/guichan/widgets/textfield.hpp @@ -138,6 +138,11 @@ namespace gcn virtual void keyPressed(KeyEvent& keyEvent); +#ifdef ANDROID + // show android keyboard on textField + virtual void disableVirtualKeyboard(int act); +#endif + protected: /** * Draws the caret. Overloaded this method if you want to diff --git a/project/jni/guichan/src/widgets/textfield.cpp b/project/jni/guichan/src/widgets/textfield.cpp index ab61d1942..55dfd15ad 100755 --- a/project/jni/guichan/src/widgets/textfield.cpp +++ b/project/jni/guichan/src/widgets/textfield.cpp @@ -54,6 +54,8 @@ #ifdef ANDROID #include + +int showAndroidKeyboard = 1; #endif namespace gcn @@ -152,7 +154,8 @@ namespace gcn void TextField::mousePressed(MouseEvent& mouseEvent) { #ifdef ANDROID - SDL_ANDROID_ToggleScreenKeyboardTextInput(getText().c_str()); + if (showAndroidKeyboard) + SDL_ANDROID_ToggleScreenKeyboardTextInput(getText().c_str()); #endif if (mouseEvent.getButton() == MouseEvent::LEFT) { @@ -284,4 +287,15 @@ namespace gcn { fixScroll(); } + +#ifdef ANDROID + // disable android virtual keyboard on textField + void TextField::disableVirtualKeyboard(int act) + { + if (act) + showAndroidKeyboard = 0; + else + showAndroidKeyboard = 1; + } +#endif }