diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-10-02 20:01:27 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-10-02 20:09:48 +0300 |
commit | 25f439c573eefbc7cff2ea92952c9c68f1f0744a (patch) | |
tree | 3ee3dec438a97926280f7d6c6f1d3621beb55545 /servers | |
parent | 1917bc3454e58fc56750b00e04aa25cb94d8d266 (diff) | |
download | redot-engine-25f439c573eefbc7cff2ea92952c9c68f1f0744a.tar.gz |
[DisplayServer] Implement has_hardware_keyboard method for Android and iOS.
Diffstat (limited to 'servers')
-rw-r--r-- | servers/display_server.cpp | 6 | ||||
-rw-r--r-- | servers/display_server.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/servers/display_server.cpp b/servers/display_server.cpp index f092e23171..ce0d6cb996 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -634,6 +634,10 @@ int DisplayServer::virtual_keyboard_get_height() const { ERR_FAIL_V_MSG(0, "Virtual keyboard not supported by this display server."); } +bool DisplayServer::has_hardware_keyboard() const { + return true; +} + void DisplayServer::cursor_set_shape(CursorShape p_shape) { WARN_PRINT("Cursor shape not supported by this display server."); } @@ -976,6 +980,8 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("virtual_keyboard_get_height"), &DisplayServer::virtual_keyboard_get_height); + ClassDB::bind_method(D_METHOD("has_hardware_keyboard"), &DisplayServer::has_hardware_keyboard); + ClassDB::bind_method(D_METHOD("cursor_set_shape", "shape"), &DisplayServer::cursor_set_shape); ClassDB::bind_method(D_METHOD("cursor_get_shape"), &DisplayServer::cursor_get_shape); ClassDB::bind_method(D_METHOD("cursor_set_custom_image", "cursor", "shape", "hotspot"), &DisplayServer::cursor_set_custom_image, DEFVAL(CURSOR_ARROW), DEFVAL(Vector2())); diff --git a/servers/display_server.h b/servers/display_server.h index b518283331..36798bd011 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -507,6 +507,8 @@ public: // returns height of the currently shown virtual keyboard (0 if keyboard is hidden) virtual int virtual_keyboard_get_height() const; + virtual bool has_hardware_keyboard() const; + enum CursorShape { CURSOR_ARROW, CURSOR_IBEAM, |