Search Unity

Mobile TouchScreenKeyboard orientation problem

Discussion in 'iOS and tvOS' started by bobcat53, Mar 2, 2013.

  1. bobcat53

    bobcat53

    Joined:
    Jul 12, 2010
    Posts:
    26
    Hi there I have a problem with TouchScreenKeyboard.

    For the game we are making, the orientation needs to be set to Landscape Left in default but on our UI, we wish to have orientation support. We have custom scripts for dealing with mobile device's orientation. However by setting the game to Landscape Left in the build settings, TouchScreenKeyboard can't autorotate according to the phone's orientation and manually setting autorotateTo* properties don't work either.

    Any ideas?

    Thanks!
     
  2. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Not sure to understand the whole problem...


    What I use to do to detect the device orientation is a simple test on the screen width and heigh during the update.
    From here if it detects a change, it set all gui scripts need.

    Finally my app is set for all possible orientation screen in the build settings and the keyboard on ios works a charm.
     
  3. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,624
    these were deprecated long ago. Use Screen class.
     
  4. bobcat53

    bobcat53

    Joined:
    Jul 12, 2010
    Posts:
    26
    We have code to detect orientation change in Update too but since ours is an AR app we had to set the build setting to Landscape Left only. This is why iOS keyboard won't autorotate. Basically I'm trying to look for a way to manually rotate the iOS keyboard at run time but it doesn't look like that's possible.

    Deprecated? But it's still updated in the docs isn't it? Screen class doesn't help me when I only want to control the iOS keyboard though.

    Anyway thank's for the input guys.
     
  5. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,624
    you cant control only keyboard rotation
    Though, judging from your desc, you can get away with hacking views hierarchy (objc side)
    also, if you are using unity gui, you can get away with doing stuff a bit differently: use RT, and rotate camera (i hope that makes sense ;-))