Updated guichan library. Added option to disable virtual keyboard

This commit is contained in:
lubomyr
2016-07-15 02:13:11 +03:00
parent e6a4ef73e1
commit bc258f633c
2 changed files with 20 additions and 1 deletions

View File

@@ -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

View File

@@ -54,6 +54,8 @@
#ifdef ANDROID
#include <SDL_screenkeyboard.h>
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
}