From 3cd0cbfdfe10e1a27976d4adba169686d3b0de07 Mon Sep 17 00:00:00 2001 From: Rachael Date: Sat, 13 May 2017 18:08:38 -0700 Subject: [PATCH] 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. --- lamp-touch.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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 -- 2.50.1