diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-07-26 20:25:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-26 20:25:53 +0200 |
commit | b19b896e061b3f117dd1a5c55123a7b710aedc75 (patch) | |
tree | cb1ad5c9b0458ab147823a34c2a9c465f40dab0e /servers | |
parent | f5a224ac925cf4ecc3e7844674514ef0fd4e3b20 (diff) | |
parent | 8c05dadcffbd31c4faeb09d222da0d3ca07c5ab0 (diff) |
Merge pull request #40487 from nekomatata/virtual-keyboard-enter-fixes
Fix Return key events in LineEdit & TextEdit on Android
Diffstat (limited to 'servers')
-rw-r--r-- | servers/display_server.cpp | 5 | ||||
-rw-r--r-- | servers/display_server.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/servers/display_server.cpp b/servers/display_server.cpp index 97de280725..8f6d6d3b99 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -31,6 +31,7 @@ #include "display_server.h" #include "core/input/input.h" +#include "core/method_bind_ext.gen.inc" #include "scene/resources/texture.h" DisplayServer *DisplayServer::singleton = nullptr; @@ -217,7 +218,7 @@ bool DisplayServer::is_console_visible() const { return false; } -void DisplayServer::virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect, int p_max_length, int p_cursor_start, int p_cursor_end) { +void DisplayServer::virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect, bool p_multiline, int p_max_length, int p_cursor_start, int p_cursor_end) { WARN_PRINT("Virtual keyboard not supported by this display server."); } @@ -459,7 +460,7 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("console_set_visible", "console_visible"), &DisplayServer::console_set_visible); ClassDB::bind_method(D_METHOD("is_console_visible"), &DisplayServer::is_console_visible); - ClassDB::bind_method(D_METHOD("virtual_keyboard_show", "existing_text", "position", "max_length", "cursor_start", "cursor_end"), &DisplayServer::virtual_keyboard_show, DEFVAL(Rect2i()), DEFVAL(-1), DEFVAL(-1), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("virtual_keyboard_show", "existing_text", "position", "multiline", "max_length", "cursor_start", "cursor_end"), &DisplayServer::virtual_keyboard_show, DEFVAL(Rect2i()), DEFVAL(false), DEFVAL(-1), DEFVAL(-1), DEFVAL(-1)); ClassDB::bind_method(D_METHOD("virtual_keyboard_hide"), &DisplayServer::virtual_keyboard_hide); ClassDB::bind_method(D_METHOD("virtual_keyboard_get_height"), &DisplayServer::virtual_keyboard_get_height); diff --git a/servers/display_server.h b/servers/display_server.h index bcfd1645d0..b652418244 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -289,7 +289,7 @@ public: virtual void console_set_visible(bool p_enabled); virtual bool is_console_visible() const; - virtual void virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), int p_max_length = -1, int p_cursor_start = -1, int p_cursor_end = -1); + virtual void virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), bool p_multiline = false, int p_max_length = -1, int p_cursor_start = -1, int p_cursor_end = -1); virtual void virtual_keyboard_hide(); // returns height of the currently shown virtual keyboard (0 if keyboard is hidden) |