summaryrefslogtreecommitdiff
path: root/platform/iphone/display_server_iphone.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/iphone/display_server_iphone.mm')
-rw-r--r--platform/iphone/display_server_iphone.mm13
1 files changed, 10 insertions, 3 deletions
diff --git a/platform/iphone/display_server_iphone.mm b/platform/iphone/display_server_iphone.mm
index d456f9cbf6..d47d131719 100644
--- a/platform/iphone/display_server_iphone.mm
+++ b/platform/iphone/display_server_iphone.mm
@@ -30,11 +30,12 @@
#include "display_server_iphone.h"
#import "app_delegate.h"
+#include "core/config/project_settings.h"
#include "core/io/file_access_pack.h"
-#include "core/project_settings.h"
#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) {