Rotate now tries to remap the arrow keys on the screen using sudo, if root privelages are not present.
Rotate now tries to remap the arrow keys on the screen using sudo, if root privelages are not present.

--- a/librotate/Rotate.py
+++ b/librotate/Rotate.py
@@ -83,5 +83,8 @@
                   xrandr.RR_ROTATE_270:[108,106,103,105]};
 	for i in keysim:
             toCode=keycodes[rotation].pop();
-            os.system("setkeycodes "+str(i)+" "+str(toCode));
+            if(os.getuid()==0):
+                os.system("setkeycodes "+str(i)+" "+str(toCode));
+            else:
+                os.system("sudo -n setkeycodes "+str(i)+" "+str(toCode));