From 2a548252d1f873999a86229e16df772781f68673 Mon Sep 17 00:00:00 2001 From: mnussbaum Date: Fri, 6 Sep 2019 00:00:27 -0700 Subject: [PATCH] Fix inverted left/right rotation with Xorg backend The accelerometer to Xorg orientation mapping had left and right inverted, causing the output to flip opposite the desired direction when used sideways. --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3f4c0ee..89f5c71 100644 --- a/src/main.rs +++ b/src/main.rs @@ -169,7 +169,7 @@ fn main() -> Result<(), String> { matrix = ["-1", "0", "1", "0", "-1", "1", "0", "0", "1"]; } else { new_state = "90"; - x_state = "left"; + x_state = "right"; matrix = ["0", "-1", "1", "1", "0", "0", "0", "0", "1"]; } } else if x > 500000 { @@ -179,7 +179,7 @@ fn main() -> Result<(), String> { matrix = ["-1", "0", "1", "0", "-1", "1", "0", "0", "1"]; } else { new_state = "270"; - x_state = "right"; + x_state = "left"; matrix = ["0", "1", "0", "-1", "0", "1", "0", "0", "1"]; } } else {