Fully disable mouse module on mouse.disable

This commit is contained in:
Matthias Richter 2013-01-23 12:38:26 +01:00
parent c1d743ddbd
commit cb553037e7

View file

@ -30,6 +30,7 @@ local x,y = 0,0
local down = false local down = false
local hot, active = nil, nil local hot, active = nil, nil
local NO_WIDGET = {} local NO_WIDGET = {}
local function _NOP_() end
local function widgetHit(mouse, pos, size) local function widgetHit(mouse, pos, size)
return mouse[1] >= pos[1] and mouse[1] <= pos[1] + size[1] and return mouse[1] >= pos[1] and mouse[1] <= pos[1] + size[1] and
@ -72,14 +73,14 @@ local function endFrame()
end end
local function disable() local function disable()
--_M.beginFrame = nothing _M.beginFrame = _NOP__
--_M.endFrame = nothing _M.endFrame = _NOP__
--_M.isHot = isHot, _M.updateWidget = _NOP__
--_M.isActive = isActive,
_M.updateWidget = function() end
end end
local function enable() local function enable()
_M.beginFrame = beginFrame
_M.endFrame = endFrame
_M.updateWidget = updateWidget _M.updateWidget = updateWidget
end end