end
local colors = { string.char(touchcolorvec(touchcolor)) }
+local colorindex = 1;
local function onblackdebounce() touch_db_blackout = nil end
local function onfndebounce() touch_db_fn = nil end
touch_db_blackout = tq:queue(300,onblackdebounce)
end
- -- left side back button: dim the display.
+ -- left side back button: reset colors and dimming.
if bit.isset(down,7) then
- dimdisplay()
+ dimfactor = 0;
+ colors = { string.char(touchcolorvec(touchcolor)) }
+ colorindex = 1;
-- Don't claim the image, just dim whatever is currently on the screen.
dodraw()
end
if touchcolor >= 48 then touchcolor = touchcolor - 48
elseif touchcolor < 0 then touchcolor = touchcolor + 48
end
- colors[1] = string.char(touchcolorvec(touchcolor))
+ colors[colorindex] = string.char(touchcolorvec(touchcolor))
end
-- front middle: mode select (rate-limited, not exactly debounced)
end
end
- -- XXX left side front button
+ -- XXX left side front button, dim the display
if bit.isset(down,5) then
+ dimdisplay()
+ -- Don't claim the image, just dim whatever is currently on the screen.
+ dodraw()
end
-- XXX left side middle button
if bit.isset(down, 6) then
+ if colorindex < ncolors then
+ colorindex = colorindex + 1;
+ else
+ colorindex = 1;
+ end
end
-- XXX front left
-- full (re)load
touchtmr:unregister()
touchlastfn = touchfns[touchfnix]
-
+ print(touchlastfn);
local drawinfo = loaddrawfn(touchlastfn)(touchtmr,touchfb,colors)
+ print(drawinfo);
cccb = drawinfo and drawinfo['cccb']
ncolors = drawinfo and drawinfo['ncolors'] or 1