keyboard splitting bug on ipad with ios 5 and 6

iOS introduced keyboard splitting/undock from iOS 5, and it may hang the keyboard in the current cocos2dx engine

Below is steps of reproducing the bug:

  1. Open TestCpp project in samples
  2. Choose the text input test
  3. Click the input field, till now, everything is fine
  4. Split the keyboard by swiping the keyboard apart with two fingers
  5. Now the keyboard hangs and it won’t take user interations. If keyboard is still active, repeat step 4, and finally it will hang!

I found the bug on iPad 3 and iPad mini with iOS 5 and iOS 6, but not able to fix it. I’m not very familiar with iOS infrastructures.

Several links mentioned similiar issues like the below one, but still I don’t know how to fix it:

Any suggestions how to fix it, guys?

will anybody take a look at this bug, or at least give me a reply, please?:frowning:

I do not know how to help you but I’ve created an issue on github: https://github.com/cocos2d/cocos2d-x/issues/2545

thx, hopes it get fixed soon

I’m with the same issua.

Any luck?

NO, the developer team seems not interested in this bug and leaves it totally to us, but i haven’t been able to find a solution yet

xiaofei yu wrote:

NO, the developer team seems not interested in this bug and leaves it totally to us, but i haven’t been able to find a solution yet

Had the same issue - the solution is to stop the opengl layer from rendering while this is happening. Here’s what I did:

  1. Register for keyboard frame change events at start of application. I did this in AppController.mm

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... [[NSNotificationCenter defaultCenter] addObserver:self selector:selector(keyboardWillChangeFrame:)
name:UIKeyboardWillChangeFrameNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:selector(keyboardDidChangeFrame:) name:UIKeyboardDidChangeFrameNotification object:nil]; ... }

  1. Started and stopped rendering during keyboard animation.
  • (void)keyboardWillChangeFrame:(NSNotification *)notification {
    // stop openGL animation while animating keyboard
    cocos2d::CCDirector::sharedDirector()~~>stopAnimation;
    }
    ~~ (void)keyboardDidChangeFrame:(NSNotification *)notification {
    // restart openGL animation when keyboard stops animating
    cocos2d::CCDirector::sharedDirector()->startAnimation();
    }

yes, it works, thanks @Winston She