mirror of https://github.com/axmolengine/axmol.git
This commit is contained in:
parent
587bcabf44
commit
83b521991f
|
@ -235,7 +235,10 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
|
|||
// Pass the touches to the superview
|
||||
#pragma mark CCEAGLView - Touch Delegate
|
||||
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
{
|
||||
if (self.isKeyboardShown)
|
||||
[self closeKeyboardOpenedByEditBox];
|
||||
|
||||
UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0};
|
||||
float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f};
|
||||
float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f};
|
||||
|
@ -546,4 +549,23 @@ namespace {
|
|||
}
|
||||
}
|
||||
|
||||
// Close the keyboard opened by EditBox
|
||||
-(void) closeKeyboardOpenedByEditBox
|
||||
{
|
||||
NSArray *subviews = self.subviews;
|
||||
|
||||
for(UIView* view in subviews)
|
||||
{
|
||||
if([view isKindOfClass:NSClassFromString(@"UITextView")] ||
|
||||
[view isKindOfClass:NSClassFromString(@"UITextField")])
|
||||
{
|
||||
if ([view isFirstResponder])
|
||||
{
|
||||
[view resignFirstResponder];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue