summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorsanikoyes <sanikoyes@163.com>2014-03-13 16:58:03 +0800
committersanikoyes <sanikoyes@163.com>2014-03-13 16:58:03 +0800
commit51429bd8d6d2fed9636e1d252a5eb86567b846ec (patch)
treef602977014d4ab0ba13dd5cf523adaafe9912ede /scene/gui
parent81757d2e977d959e6b0bc26f9fa990417ca91de9 (diff)
fix android can't input unicode characters
fix hide soft keyboard by press 'back' button, then click current focus text edit/line edit control, soft keyboard won't show again add features: press enter key with line edit control will hide soft keyboard
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/line_edit.cpp5
-rw-r--r--scene/gui/text_edit.cpp2
2 files changed, 7 insertions, 0 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 22316acaba..6c9db7484b 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -79,6 +79,9 @@ void LineEdit::_input_event(InputEvent p_event) {
}
selection.creating=false;
selection.doubleclick=false;
+
+ // notify to show soft keyboard
+ notification(NOTIFICATION_FOCUS_ENTER);
}
update();
@@ -208,6 +211,8 @@ void LineEdit::_input_event(InputEvent p_event) {
case KEY_RETURN: {
emit_signal( "text_entered",text );
+ // notify to hide soft keyboard
+ notification(NOTIFICATION_FOCUS_EXIT);
return;
} break;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 18c8c0e9f7..233e3bee66 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -857,6 +857,8 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
} else {
selection.selecting_mode=Selection::MODE_NONE;
+ // notify to show soft keyboard
+ notification(NOTIFICATION_FOCUS_ENTER);
}
} break;