|
@@ -118,7 +118,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
|
|
selection.creating = false;
|
|
selection.creating = false;
|
|
selection.doubleclick = false;
|
|
selection.doubleclick = false;
|
|
|
|
|
|
- if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD)) {
|
|
|
|
|
|
+ if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) {
|
|
if (selection.enabled) {
|
|
if (selection.enabled) {
|
|
DisplayServer::get_singleton()->virtual_keyboard_show(text, get_global_rect(), max_length, selection.begin, selection.end);
|
|
DisplayServer::get_singleton()->virtual_keyboard_show(text, get_global_rect(), max_length, selection.begin, selection.end);
|
|
} else {
|
|
} else {
|
|
@@ -309,7 +309,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
|
|
case KEY_KP_ENTER:
|
|
case KEY_KP_ENTER:
|
|
case KEY_ENTER: {
|
|
case KEY_ENTER: {
|
|
emit_signal("text_entered", text);
|
|
emit_signal("text_entered", text);
|
|
- if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD)) {
|
|
|
|
|
|
+ if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) {
|
|
DisplayServer::get_singleton()->virtual_keyboard_hide();
|
|
DisplayServer::get_singleton()->virtual_keyboard_hide();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -937,7 +937,7 @@ void LineEdit::_notification(int p_what) {
|
|
DisplayServer::get_singleton()->window_set_ime_position(get_global_position() + cursor_pos, get_viewport()->get_window_id());
|
|
DisplayServer::get_singleton()->window_set_ime_position(get_global_position() + cursor_pos, get_viewport()->get_window_id());
|
|
}
|
|
}
|
|
|
|
|
|
- if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD)) {
|
|
|
|
|
|
+ if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) {
|
|
if (selection.enabled) {
|
|
if (selection.enabled) {
|
|
DisplayServer::get_singleton()->virtual_keyboard_show(text, get_global_rect(), max_length, selection.begin, selection.end);
|
|
DisplayServer::get_singleton()->virtual_keyboard_show(text, get_global_rect(), max_length, selection.begin, selection.end);
|
|
} else {
|
|
} else {
|
|
@@ -958,7 +958,7 @@ void LineEdit::_notification(int p_what) {
|
|
ime_text = "";
|
|
ime_text = "";
|
|
ime_selection = Point2();
|
|
ime_selection = Point2();
|
|
|
|
|
|
- if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD)) {
|
|
|
|
|
|
+ if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) {
|
|
DisplayServer::get_singleton()->virtual_keyboard_hide();
|
|
DisplayServer::get_singleton()->virtual_keyboard_hide();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1658,6 +1658,14 @@ bool LineEdit::is_shortcut_keys_enabled() const {
|
|
return shortcut_keys_enabled;
|
|
return shortcut_keys_enabled;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void LineEdit::set_virtual_keyboard_enabled(bool p_enable) {
|
|
|
|
+ virtual_keyboard_enabled = p_enable;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool LineEdit::is_virtual_keyboard_enabled() const {
|
|
|
|
+ return virtual_keyboard_enabled;
|
|
|
|
+}
|
|
|
|
+
|
|
void LineEdit::set_selecting_enabled(bool p_enabled) {
|
|
void LineEdit::set_selecting_enabled(bool p_enabled) {
|
|
selecting_enabled = p_enabled;
|
|
selecting_enabled = p_enabled;
|
|
|
|
|
|
@@ -1813,6 +1821,8 @@ void LineEdit::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("get_menu"), &LineEdit::get_menu);
|
|
ClassDB::bind_method(D_METHOD("get_menu"), &LineEdit::get_menu);
|
|
ClassDB::bind_method(D_METHOD("set_context_menu_enabled", "enable"), &LineEdit::set_context_menu_enabled);
|
|
ClassDB::bind_method(D_METHOD("set_context_menu_enabled", "enable"), &LineEdit::set_context_menu_enabled);
|
|
ClassDB::bind_method(D_METHOD("is_context_menu_enabled"), &LineEdit::is_context_menu_enabled);
|
|
ClassDB::bind_method(D_METHOD("is_context_menu_enabled"), &LineEdit::is_context_menu_enabled);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_virtual_keyboard_enabled", "enable"), &LineEdit::set_virtual_keyboard_enabled);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("is_virtual_keyboard_enabled"), &LineEdit::is_virtual_keyboard_enabled);
|
|
ClassDB::bind_method(D_METHOD("set_clear_button_enabled", "enable"), &LineEdit::set_clear_button_enabled);
|
|
ClassDB::bind_method(D_METHOD("set_clear_button_enabled", "enable"), &LineEdit::set_clear_button_enabled);
|
|
ClassDB::bind_method(D_METHOD("is_clear_button_enabled"), &LineEdit::is_clear_button_enabled);
|
|
ClassDB::bind_method(D_METHOD("is_clear_button_enabled"), &LineEdit::is_clear_button_enabled);
|
|
ClassDB::bind_method(D_METHOD("set_shortcut_keys_enabled", "enable"), &LineEdit::set_shortcut_keys_enabled);
|
|
ClassDB::bind_method(D_METHOD("set_shortcut_keys_enabled", "enable"), &LineEdit::set_shortcut_keys_enabled);
|
|
@@ -1848,6 +1858,7 @@ void LineEdit::_bind_methods() {
|
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "secret_character"), "set_secret_character", "get_secret_character");
|
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "secret_character"), "set_secret_character", "get_secret_character");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "expand_to_text_length"), "set_expand_to_text_length", "get_expand_to_text_length");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "expand_to_text_length"), "set_expand_to_text_length", "get_expand_to_text_length");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "context_menu_enabled"), "set_context_menu_enabled", "is_context_menu_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "context_menu_enabled"), "set_context_menu_enabled", "is_context_menu_enabled");
|
|
|
|
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "virtual_keyboard_enabled"), "set_virtual_keyboard_enabled", "is_virtual_keyboard_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clear_button_enabled"), "set_clear_button_enabled", "is_clear_button_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clear_button_enabled"), "set_clear_button_enabled", "is_clear_button_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortcut_keys_enabled"), "set_shortcut_keys_enabled", "is_shortcut_keys_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortcut_keys_enabled"), "set_shortcut_keys_enabled", "is_shortcut_keys_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selecting_enabled"), "set_selecting_enabled", "is_selecting_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selecting_enabled"), "set_selecting_enabled", "is_selecting_enabled");
|