Triggers for device facing to a certain position

Shobdoo

New member
Hi, I see if I use an if statement I can see I can check if the device is facing a certain direction (face up/down, vertical upright/downright, and sideways left/right). However I find myself many times wanting to use this as a trigger but can only see triggers for facedown->faceup, faceup->facedown, and any->facedown and none for lets say any->vertical upright. The only way currently of implementing this is a while loop which constantly checks the facing status of the phone through an if statement. The problem with this is it is quite inefficient as I would only like to check during a certain orientation change, not constantly and is possible to miss if the device facing change is between checks, lets say it checks every 2 seconds but the orientation only changed for 1 second between this checking period. Essentially the functionality is there through if statements but cannot be properly utilized as a trigger. If these triggers could be added I feel it would be quite useful and very much appreciated.
 

riothamus

New member
I am also interested in this implementation. I'd use it to turn off the screen when upside down vertical in a pocket.
 
Top