From 01f4afddcfa62247d2c449bd4a8f4578f3e2feb9 Mon Sep 17 00:00:00 2001 From: AykoPoel Date: Sun, 1 Feb 2015 12:28:05 +0100 Subject: [PATCH] Update autorotate.py Had some issue that touch is deactivated at start should be fixed... --- autorotate/autorotate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autorotate/autorotate.py b/autorotate/autorotate.py index b86210f..a407e5c 100755 --- a/autorotate/autorotate.py +++ b/autorotate/autorotate.py @@ -52,6 +52,7 @@ state_dict = {0: "normal", 1: "inverted", 2: "right", 3: "left"} current_state = 0 previous_tstate = "on" previousStylusProximityStatus = "out" +firstrun = True #ACCELEROMETER with open(dpath + 'in_accel_scale') as f: scale = float(f.readline()) @@ -123,9 +124,10 @@ while True: if str(tstatus[0]) == "off" and stylusProximityStatus == "in": print("TOUCH: " + tstatus[0]) print(" PEN: " + stylusProximityStatus) - elif str(tstatus[0]) == "on" and stylusProximityStatus == "in": + elif str(tstatus[0]) == "on" and stylusProximityStatus == "in" and firstrun == False: os.system('xinput disable "NTRG0001:01 1B96:1B05"') print("TOUCH: " + "off") print(" PEN: " + stylusProximityStatus) elif stylusProximityStatus == "out": print(" PEN: " + stylusProximityStatus) + firstrun == False