From dcb5b350d8f625ca8425d402457b2dc8d931b213 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sun, 16 Oct 2016 12:21:10 -0400 Subject: [PATCH] lamp/example: tweak touch UI, improve dox --- README.rst | 16 ++++++++++++---- lamp-touch.lua | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index de80ae5..69a074a 100644 --- a/README.rst +++ b/README.rst @@ -94,8 +94,11 @@ At present, there are four used touch channels: * A "blackout" button, which disables drawing to the display and any other user interaction until touched again. This button may be toggled at most - once per touch interaction; once toggled, the user must allow the touch - handler to timeout. This provides a crude "debounce" facility and allows + once per touch; once toggled, the system will not toggle blackout again + until the touch sensor has been untouched for a timeout (see + ``touch_db_blackout``). + + This provides a crude "debounce" facility and allows for things like moving the lamp to a new surface (with new conductive properties) by gripping it in a way that touches this sensor and holding it on the new surface for some seconds to allow the CAP1188 to @@ -105,8 +108,13 @@ At present, there are four used touch channels: and, if both are active, the wheel advances "slowly". * A shape selector toggle. This advances through the collections of - drawings enumerated at the beginning of a touch event. Each separate - interaction will reload the list for ease of development. + drawings enumerated at the beginning of a touch event. This interaction + is rate-limited, so that holding the button will only slowly advance + through the space of drawings (see ``touch_db_fn``). Note that releasing + the button immediately clears the timeout, unlike blackout above. + + Each separate touch interaction will reload the list for ease of + development. Notes ##### diff --git a/lamp-touch.lua b/lamp-touch.lua index 75f56d3..d56a9cd 100644 --- a/lamp-touch.lua +++ b/lamp-touch.lua @@ -123,6 +123,7 @@ local function ontouch() touch_db_fn = tq:queue(200,onfndebounce) end claimfb() + elseif touch_db_fn then tq:dequeue(touch_db_fn); touch_db_fn = nil end end -- 2.50.1