Skip to content

Commit f906617

Browse files
authored
add missing function (#20250)
1 parent df76b1e commit f906617

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

cocos/platform/ios/CCEAGLView-ios.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
130130
-(void) doAnimationWhenKeyboardMoveWithDuration:(float) duration distance:(float) dis;
131131
-(void) doAnimationWhenAnotherEditBeClicked;
132132

133-
- (void) showKeyboard;
134-
- (void) hideKeyboard;
133+
-(void) showKeyboard;
134+
-(void) hideKeyboard;
135+
-(BOOL) isKeyboardShown;
135136
@end

cocos/platform/ios/CCEAGLView-ios.mm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
7777
#define IOS_MAX_TOUCHES_COUNT 10
7878

7979
@interface CCEAGLView ()
80-
@property (nonatomic) UIView* textInputView;
81-
- (BOOL) setupSurfaceWithSharegroup:(EAGLSharegroup*)sharegroup;
82-
- (unsigned int) convertPixelFormat:(NSString*) pixelFormat;
80+
@property (nonatomic) CCInputView* textInputView;
8381
@end
8482

8583
@implementation CCEAGLView
@@ -466,6 +464,11 @@ - (void) hideKeyboard
466464
[self.textInputView removeFromSuperview];
467465
}
468466

467+
-(BOOL) isKeyboardShown
468+
{
469+
return [self.textInputView isKeyboardShown];
470+
}
471+
469472
-(void) doAnimationWhenKeyboardMoveWithDuration:(float) duration distance:(float) dis
470473
{
471474

cocos/platform/ios/CCInputView-ios.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import <UIKit/UIKit.h>
22

33
@interface CCInputView : UIView <UITextInput>
4+
@property(nonatomic) BOOL isKeyboardShown;
45
@end

cocos/platform/ios/CCInputView-ios.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
@interface CCInputView ()
66

77
@property(nonatomic) NSString* myMarkedText;
8-
@property(nonatomic) BOOL isKeyboardShown;
98

109
@end
1110

@@ -332,6 +331,7 @@ - (void)onUIKeyboardNotification:(NSNotification *)notif
332331
else if (UIKeyboardDidShowNotification == type)
333332
{
334333
//CGSize screenSize = self.window.screen.bounds.size;
334+
self.isKeyboardShown = YES;
335335
dispatcher->dispatchKeyboardDidShow(notiInfo);
336336
}
337337
else if (UIKeyboardWillHideNotification == type)
@@ -340,6 +340,7 @@ - (void)onUIKeyboardNotification:(NSNotification *)notif
340340
}
341341
else if (UIKeyboardDidHideNotification == type)
342342
{
343+
self.isKeyboardShown = NO;
343344
dispatcher->dispatchKeyboardDidHide(notiInfo);
344345
}
345346
}

0 commit comments

Comments
 (0)