diff options
author | Sergey Minakov <naithar@icloud.com> | 2020-11-15 15:11:25 +0300 |
---|---|---|
committer | Sergey Minakov <naithar@icloud.com> | 2020-11-15 16:22:57 +0300 |
commit | 2d8c311c01bf9614bd63f5edd3323d6004c42fb8 (patch) | |
tree | 3b40ba1097e4d6005d32d8174a1a5ff872a53595 /platform/iphone/display_server_iphone.mm | |
parent | 8894c64e54f25a37f2594bb1dd34075084a99ae1 (diff) | |
download | redot-engine-2d8c311c01bf9614bd63f5edd3323d6004c42fb8.tar.gz |
iOS: fix keyboard display
Diffstat (limited to 'platform/iphone/display_server_iphone.mm')
-rw-r--r-- | platform/iphone/display_server_iphone.mm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/platform/iphone/display_server_iphone.mm b/platform/iphone/display_server_iphone.mm index 6fa5e6ee4a..d47d131719 100644 --- a/platform/iphone/display_server_iphone.mm +++ b/platform/iphone/display_server_iphone.mm @@ -35,6 +35,7 @@ #import "device_metrics.h" #import "godot_view.h" #include "ios.h" +#import "keyboard_input_view.h" #import "native_video_view.h" #include "os_iphone.h" #import "view_controller.h" @@ -529,11 +530,17 @@ bool DisplayServerIPhone::screen_is_touchscreen(int p_screen) const { } void DisplayServerIPhone::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) { - [AppDelegate.viewController.godotView becomeFirstResponderWithString:p_existing_text]; + NSString *existingString = [[NSString alloc] initWithUTF8String:p_existing_text.utf8().get_data()]; + + [AppDelegate.viewController.keyboardView + becomeFirstResponderWithString:existingString + multiline:p_multiline + cursorStart:p_cursor_start + cursorEnd:p_cursor_end]; } void DisplayServerIPhone::virtual_keyboard_hide() { - [AppDelegate.viewController.godotView resignFirstResponder]; + [AppDelegate.viewController.keyboardView resignFirstResponder]; } void DisplayServerIPhone::virtual_keyboard_set_height(int height) { |