Add gui.keyboard.getFocus() and gui.mouse.getHot()
This commit is contained in:
parent
c85a877dcc
commit
faa295651a
2 changed files with 9 additions and 5 deletions
|
@ -39,6 +39,7 @@ local function setFocus(id) focus = id end
|
||||||
local function disable() focus = NO_WIDGET end
|
local function disable() focus = NO_WIDGET end
|
||||||
local function clearFocus() focus = nil end
|
local function clearFocus() focus = nil end
|
||||||
local function hasFocus(id) return id == focus end
|
local function hasFocus(id) return id == focus end
|
||||||
|
local function getFocus() return focus end
|
||||||
|
|
||||||
local function tryGrab(id)
|
local function tryGrab(id)
|
||||||
if not focus then
|
if not focus then
|
||||||
|
@ -79,6 +80,7 @@ return setmetatable({
|
||||||
tryGrab = tryGrab,
|
tryGrab = tryGrab,
|
||||||
isBindingDown = isBindingDown,
|
isBindingDown = isBindingDown,
|
||||||
setFocus = setFocus,
|
setFocus = setFocus,
|
||||||
|
getFocus = getFocus,
|
||||||
clearFocus = clearFocus,
|
clearFocus = clearFocus,
|
||||||
hasFocus = hasFocus,
|
hasFocus = hasFocus,
|
||||||
makeCyclable = makeCyclable,
|
makeCyclable = makeCyclable,
|
||||||
|
|
|
@ -40,6 +40,7 @@ local function setHot(id) hot = id end
|
||||||
local function setActive(id) active = id end
|
local function setActive(id) active = id end
|
||||||
local function isHot(id) return id == hot end
|
local function isHot(id) return id == hot end
|
||||||
local function isActive(id) return id == active end
|
local function isActive(id) return id == active end
|
||||||
|
local function getHot() return hot end
|
||||||
|
|
||||||
local function updateWidget(id, pos, size, hit)
|
local function updateWidget(id, pos, size, hit)
|
||||||
hit = hit or _M.widgetHit
|
hit = hit or _M.widgetHit
|
||||||
|
@ -85,6 +86,7 @@ end
|
||||||
_M = {
|
_M = {
|
||||||
widgetHit = widgetHit,
|
widgetHit = widgetHit,
|
||||||
setHot = setHot,
|
setHot = setHot,
|
||||||
|
getHot = getHot,
|
||||||
setActive = setActive,
|
setActive = setActive,
|
||||||
isHot = isHot,
|
isHot = isHot,
|
||||||
isActive = isActive,
|
isActive = isActive,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue