Blackberry tablets have reversed accelerometer values (y = x) due to their landscape affinity. The only Blackberry tablet is also the only device with 1024 pixel width, so check for this as it is easier than looking up machine ID.

This commit is contained in:
Sacha committed 2013-04-12 00:21:35 +10:00
1 parent 9c96dcea91
commit bd7bee5a11
1 file changed
+9 -1
+9 -1
View File
@@ -473,7 +473,15 @@ int main(int argc, char *argv[]) {
// Handle accelerometer
double x, y, z;
accelerometer_read_forces(&x, &y, &z);
input_state.acc.x = x; input_state.acc.y = y; input_state.acc.z = z;
if (pixel_xres == 1024) // Playbook has this reversed
{
input_state.acc.x = y;
input_state.acc.y = x;
} else {
input_state.acc.x = x;
input_state.acc.y = y;
}
input_state.acc.z = z;
UpdateInputState(&input_state);
NativeUpdate(input_state);
EndInputState(&input_state);