Keyboard Orientation Problem

Hi,

I have a problem with the orientation of the keyboard on iOS4 and iPhone. I use the following code in a Start function (I’ve tried in Awake as well, same problem):

iPhoneKeyboard.autorotateToPortrait = false;
iPhoneKeyboard.autorotateToPortraitUpsideDown = false;
iPhoneKeyboard.autorotateToLandscapeRight = true;
iPhoneKeyboard.autorotateToLandscapeLeft = false;

When I launch the application and tap the GUIText input, if I did not rotate the iPhone to the right, the keyboard shows first in Portrait mode.

And then, if I rotate the iPhone to the right, the keyboard rotates to the right and from then on, won’t rotate back to any other orientation (which is what I want).

Is there a way to set the Keyboard orientation from the start, so that when it first appears, it displays in the proper orientation?

I’ve searched the forum and found a couple of threads on the subject, but did not find anything addressing this specific issue.

Any help or information welcomed.

Thanks,

I got the same problem, did you figure out a solution?

Not yet. I was surprised so far not to see anyone having the same issue. Glad to see I’m not the only one.

Did you find a way to do it?

I’m having the same issue, using the same code in an Awake function. Usually it works if the device is held with the right orientation at startup, but will often fail to auto-rotate correctly into place if I have it laying flat on my desk during the app’s initial launch. Ideally we could set the keyboard’s initial rotation manually, but apparently that’s not possible according to the Unity docs…

“Apple’s API does not allow to explicitly control the orientation of the keyboard. Instead you can define iPhoneKeyboard.autorotateToPortrait, iPhoneKeyboard.autorotateToPortraitUpsideDown, iPhoneKeyboard.autorotateToLandscapeLeft, iPhoneKeyboard.autorotateToLandscapeRight if the keyboard needs to be automatically rotated to match a specific orientation of the device.”