From 4795f2b68a4fd7023c2f85a79c1b7686b9226747 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Tue, 12 Feb 2019 23:48:14 +0000 Subject: IOS: Implement kFeatureVirtualKeyboard to show/hide the keyboard --- backends/platform/ios7/ios7_osys_video.mm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'backends/platform/ios7/ios7_osys_video.mm') diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm index 3196f88822..20cf687709 100644 --- a/backends/platform/ios7/ios7_osys_video.mm +++ b/backends/platform/ios7/ios7_osys_video.mm @@ -583,3 +583,23 @@ void OSystem_iOS7::updateMouseTexture() { [[iOS7AppDelegate iPhoneView] updateMouseCursor]; }); } + +void OSystem_iOS7::setShowKeyboard(bool show) { + if (show) { + execute_on_main_thread(^ { + [[iOS7AppDelegate iPhoneView] showKeyboard]; + }); + } else { + // Do not hide the keyboard in portrait mode as it is shown automatically and not + // just when asked with the kFeatureVirtualKeyboard. + if (_screenOrientation == kScreenOrientationLandscape || _screenOrientation == kScreenOrientationFlippedLandscape) { + execute_on_main_thread(^ { + [[iOS7AppDelegate iPhoneView] hideKeyboard]; + }); + } + } +} + +bool OSystem_iOS7::isKeyboardShown() const { + return [[iOS7AppDelegate iPhoneView] isKeyboardShown]; +} -- cgit v1.2.3