diff options
-rw-r--r-- | keyboard.lua | 12 | ||||
-rw-r--r-- | mouse.lua | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/keyboard.lua b/keyboard.lua index 30d8c43..f6ae2e1 100644 --- a/keyboard.lua +++ b/keyboard.lua @@ -34,11 +34,12 @@ local cycle = { next = {key = 'tab'}, } -local function pressed(...) key, code = ... end -local function setFocus(id) focus = id end -local function disable() focus = NO_WIDGET end -local function clearFocus() focus = nil end -local function hasFocus(id) return id == focus end +local function pressed(...) key, code = ... end +local function setFocus(id) focus = id end +local function disable() focus = NO_WIDGET end +local function clearFocus() focus = nil end +local function hasFocus(id) return id == focus end +local function getFocus() return focus end local function tryGrab(id) if not focus then @@ -79,6 +80,7 @@ return setmetatable({ tryGrab = tryGrab, isBindingDown = isBindingDown, setFocus = setFocus, + getFocus = getFocus, clearFocus = clearFocus, hasFocus = hasFocus, makeCyclable = makeCyclable, @@ -40,6 +40,7 @@ local function setHot(id) hot = id end local function setActive(id) active = id end local function isHot(id) return id == hot end local function isActive(id) return id == active end +local function getHot() return hot end local function updateWidget(id, pos, size, hit) hit = hit or _M.widgetHit @@ -85,6 +86,7 @@ end _M = { widgetHit = widgetHit, setHot = setHot, + getHot = getHot, setActive = setActive, isHot = isHot, isActive = isActive, |