Is it possible to generate an event when the Device is placed on a flat surface?

Discussion in 'iPhone/iPad Programming' started by fenrus110, Nov 17, 2008.

  1. macrumors regular

    Joined:
    Mar 24, 2008
    #1
    Not sure if this is even possible, but my client wants to auto bring up the keyboard and rotate the view to Landscape when the Device is placed on a flat surface.

    From my experiences, rotation events only trigger if the device is perpendicular to the ground.

    Not to mention, how the Device would know if the device is on the palm of a hand or on a table...
     
  2. macrumors member

    Joined:
    Mar 23, 2008
    #2
    Checking the accelerometer values will give you the info you need, although you will probably need to accept a small range of rotation angles that are close enough to level in 2 axes that the surface can be considered "flat" - did you really mean "perpendicular to the gravity vector" when you said "flat'?

    Chris
     
  3. macrumors 603

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #3
    A human palm rarely stay as motionless as a table. Find a Tai Chi master, have him hold an iPhone as flat as possible for a few seconds. Any less deviation found by the accelerometer in the X and Y axis's over the course of a few seconds, and it's probably a table top.

    .
     

Share This Page