aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Richter <vrld@vrld.org>2012-09-03 15:30:17 +0200
committerMatthias Richter <vrld@vrld.org>2012-09-03 15:30:17 +0200
commitd3b1a1c00d2c984f0815cb260a753d096d3b858e (patch)
tree2931afdea62887b34dd5618be9b407695a4d4631
parentfd8664c80af386572dd47cee076c06d9442ef222 (diff)
downloadQuickie-d3b1a1c00d2c984f0815cb260a753d096d3b858e.tar.gz
Quickie-d3b1a1c00d2c984f0815cb260a753d096d3b858e.tar.bz2
Quickie-d3b1a1c00d2c984f0815cb260a753d096d3b858e.tar.xz
Quickie-d3b1a1c00d2c984f0815cb260a753d096d3b858e.zip
Fix #4: keyboard.disableFocus() not working.
Used undefined variable NO_WIDGET to clear keyboard focus. Same error was made in mouse.lua.
-rw-r--r--core.lua2
-rw-r--r--keyboard.lua1
-rw-r--r--mouse.lua1
3 files changed, 3 insertions, 1 deletions
diff --git a/core.lua b/core.lua
index 371b114..42a43cf 100644
--- a/core.lua
+++ b/core.lua
@@ -24,7 +24,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
]]--
-local NO_WIDGET = function()end
local BASE = (...):match("(.-)[^%.]+$")
local group = require(BASE .. 'group')
local mouse = require(BASE .. 'mouse')
@@ -83,6 +82,7 @@ local function registerDraw(id, f, ...)
if mouse.isHot(id) or keyboard.hasFocus(id) then
state = mouse.isActive(id) and 'active' or 'hot'
end
+ print(id, keyboard.hasFocus(id))
local rest = save_pack(...)
draw_items.n = draw_items.n + 1
draw_items[draw_items.n] = function()
diff --git a/keyboard.lua b/keyboard.lua
index 0b20570..de0786e 100644
--- a/keyboard.lua
+++ b/keyboard.lua
@@ -26,6 +26,7 @@ THE SOFTWARE.
local key,code = nil, -1
local focus, lastwidget
+local NO_WIDGET = {}
local cycle = {
-- binding = {key = key, modifier1, modifier2, ...} XXX: modifiers are OR-ed!
diff --git a/mouse.lua b/mouse.lua
index eac46f5..75b6e17 100644
--- a/mouse.lua
+++ b/mouse.lua
@@ -29,6 +29,7 @@ local _M -- holds the module. needed to make widgetHit overridable
local x,y = 0,0
local down = false
local hot, active = nil, nil
+local NO_WIDGET = {}
local function widgetHit(mouse, pos, size)
return mouse[1] >= pos[1] and mouse[1] <= pos[1] + size[1] and