From bd7bee5a11cd01ebf9f2e8445db7fedab7e3b295 Mon Sep 17 00:00:00 2001 From: Sacha Date: Fri, 12 Apr 2013 00:21:35 +1000 Subject: [PATCH] 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. --- base/BlackberryMain.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/base/BlackberryMain.cpp b/base/BlackberryMain.cpp index af99394468..ee15770c9e 100644 --- a/base/BlackberryMain.cpp +++ b/base/BlackberryMain.cpp @@ -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);