sensor_remap_coordinates()

Coordinates from a sensor event will be remapped based on the angle.

Synopsis:

#include <bps/sensor.h>
 
BPS_API int sensor_remap_coordinates(int angle)

Since:

BlackBerry 10.0.0

Arguments:

angle

The angle (in degrees) to base the remapping off of. Must be a value of 0, 90, 180, or 270. A value of 0 effectively disables remapping.

Library:

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

Description:

The x, y, and z values are based off of an angle of 0. After calling this function, getting axis values from events will automatically be corrected based on the provided angle.

The initial angle of the application is provided in the "ORIENTATION" environment variable. That value can be converted to an int and passed into this function.

On a rotation event, the new angle will be provided in the event, it can be extracted and passed into this function.

Returns:

BPS_SUCCESS upon success. Otherwise, BPS_FAILURE with the errno set.

Last modified: 2014-09-30



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

comments powered by Disqus