diff options
| author | Gilles Roudiere | 2017-10-04 18:16:28 +0200 |
|---|---|---|
| committer | GitHub | 2017-10-04 18:16:28 +0200 |
| commit | 5b9b158354c9b3eaa5bcebd726347dd9db704096 (patch) | |
| tree | 2e6a0906a3585772d7348ac820356dcac1ff47b6 /core | |
| parent | 7c2cda72b859509758f43e60fee6798b6175590b (diff) | |
| parent | 275e537058ed870c4d37002f2110b7866d2ed1ae (diff) | |
| download | godot-5b9b158354c9b3eaa5bcebd726347dd9db704096.tar.gz godot-5b9b158354c9b3eaa5bcebd726347dd9db704096.tar.zst godot-5b9b158354c9b3eaa5bcebd726347dd9db704096.zip | |
Merge pull request #11823 from endragor/virtual-keyboard-height
Allow to obtain virtual keyboard height
Diffstat (limited to 'core')
| -rw-r--r-- | core/bind/core_bind.cpp | 5 | ||||
| -rw-r--r-- | core/bind/core_bind.h | 1 | ||||
| -rw-r--r-- | core/os/os.cpp | 4 | ||||
| -rw-r--r-- | core/os/os.h | 3 |
4 files changed, 13 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 9c655b946..b47e611a5 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -868,6 +868,10 @@ void _OS::hide_virtual_keyboard() { OS::get_singleton()->hide_virtual_keyboard(); } +int _OS::get_virtual_keyboard_height() { + return OS::get_singleton()->get_virtual_keyboard_height(); +} + void _OS::print_all_resources(const String &p_to_file) { OS::get_singleton()->print_all_resources(p_to_file); @@ -1075,6 +1079,7 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("has_virtual_keyboard"), &_OS::has_virtual_keyboard); ClassDB::bind_method(D_METHOD("show_virtual_keyboard", "existing_text"), &_OS::show_virtual_keyboard, DEFVAL("")); ClassDB::bind_method(D_METHOD("hide_virtual_keyboard"), &_OS::hide_virtual_keyboard); + ClassDB::bind_method(D_METHOD("get_virtual_keyboard_height"), &_OS::get_virtual_keyboard_height); ClassDB::bind_method(D_METHOD("print_resources_in_use", "short"), &_OS::print_resources_in_use, DEFVAL(false)); ClassDB::bind_method(D_METHOD("print_all_resources", "tofile"), &_OS::print_all_resources, DEFVAL("")); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index d69cb86e4..7f8c734e3 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -204,6 +204,7 @@ public: bool has_virtual_keyboard() const; void show_virtual_keyboard(const String &p_existing_text = ""); void hide_virtual_keyboard(); + int get_virtual_keyboard_height(); void print_resources_in_use(bool p_short = false); void print_all_resources(const String &p_to_file); diff --git a/core/os/os.cpp b/core/os/os.cpp index f2295823b..4accd65ba 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -193,6 +193,10 @@ void OS::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_scr void OS::hide_virtual_keyboard() { } +int OS::get_virtual_keyboard_height() const { + return 0; +} + void OS::print_all_resources(String p_to_file) { ERR_FAIL_COND(p_to_file != "" && _OSPRF); diff --git a/core/os/os.h b/core/os/os.h index e819666a7..6fcfd7133 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -315,6 +315,9 @@ public: virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2()); virtual void hide_virtual_keyboard(); + // returns height of the currently shown virtual keyboard (0 if keyboard is hidden) + virtual int get_virtual_keyboard_height() const; + virtual void set_cursor_shape(CursorShape p_shape) = 0; virtual bool get_swap_ok_cancel() { return false; } |
