]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_lamp/commitdiff
fixed a bug wherein it would switch to the last local image before dimming. Now...
authorRachael <srbennett@gmail.com>
Sun, 14 May 2017 01:08:38 +0000 (18:08 -0700)
committerRachael <srbennett@gmail.com>
Sun, 14 May 2017 01:08:38 +0000 (18:08 -0700)
lamp-touch.lua

index 79354cd95fc27bc2eb2cf43f78f3bb0965c41c13..d5bba7bc95ddcf4f70e8674cbeb723d99910b2a2 100644 (file)
@@ -10,6 +10,7 @@ local touch_db_blackout = nil
 local touch_db_fn = nil
 local touchfns    = { }
 local touchfnix = 1
+local dimonly = false
 
 if touchcolor == nil then touchcolor = 40 end
 if touchlastfn == nil then touchlastfn = "fill" end
@@ -125,7 +126,14 @@ local function ontouch()
     touch_db_blackout = tq:queue(300,onblackdebounce)
   end
 
-  if not isblackout then
+  -- XXX front left: dim the display
+  if bit.isset(down,4) then
+    dimdisplay()
+    -- Don't claim the image, just dim whatever is currently on the screen.
+    dodraw()
+  end
+
+  if not isblackout and not dimonly then
     -- front right buttons: local color wheel
     if bit.isset(down,1) then
       -- go forward quickly or slowly
@@ -156,12 +164,6 @@ local function ontouch()
     end
   end
 
-  -- XXX front left: dim the display
-  if bit.isset(down,4) then
-    dimdisplay()
-    claimfb()
-  end
-
   -- XXX left side front button
   if bit.isset(down,5) then
   end