sensor_event_get_orientation_angle()

Returns the device orientation in degrees: 0, 90, 180, or 270.

Synopsis:

#include <bps/sensor.h>
 
BPS_API int sensor_event_get_orientation_angle(bps_event_t *event)

Since:

BlackBerry 10.0.0

Arguments:

event

The SENSOR_ORIENTATION_READING event.

Library:

libbps (For the qcc command, use the -l bps option to link against this library)

Description:

Fetch the device orientation angle from a SENSOR_ORIENTATION_READING event. Possible results are 0, 90, 180, or 270 degrees.

This is the device orientation angle relative to gravity, which may not match the screen orientation. For example, the device may physically be in landscape mode, but the application may be restricted to portrait mode. In such a case, this function would return an orientation angle that implies landscape mode, but the application's screen orientation would be in portrait mode.

Returns:

0, 90, 180, or 270 when the function completes successfully, -1 with the errno value set otherwise.

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus