From: Rachael Date: Sun, 14 May 2017 01:08:38 +0000 (-0700) Subject: fixed a bug wherein it would switch to the last local image before dimming. Now... X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=3cd0cbfdfe10e1a27976d4adba169686d3b0de07;p=acmetensortoys-esp-lua_lamp fixed a bug wherein it would switch to the last local image before dimming. Now it will instead dim whatever is on the screen, local or remote. --- diff --git a/lamp-touch.lua b/lamp-touch.lua index 79354cd..d5bba7b 100644 --- a/lamp-touch.lua +++ b/lamp-touch.lua @@ -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