diff options
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) { |