diff --git a/core/input.lua b/core/input.lua index f5d2c13..597649b 100644 --- a/core/input.lua +++ b/core/input.lua @@ -59,6 +59,11 @@ love.handlers['mousemoved'] = function(x, y, dx, dy, e, f) orig.mousemoved(x, y, dx, dy, e, f) end end +love.handlers['filedropped'] = function(file, y, dx, dy, e, f) + if not input.eventHandlers.filedropped(file, y, dx, dy, e, f) then + orig.filedropped(file, y, dx, dy, e, f) + end +end local function sortFunc(t1, t2) if t1 == t2 then @@ -315,6 +320,21 @@ function input.eventHandlers.keypressed(btn, btncode) return captured end +function input.eventHandlers.filedropped(file) + local captured = false + if input.subscriptions.filedropped then + for index, sub in ipairs(input.subscriptions.filedropped) do + if sub.active and sub.stack.element.settings.active then + sub:emit(file) + captured = true + end + + end + end + + return captured +end + function input.eventHandlers.keyreleased(btn, btncode) local captured = false if input.subscriptions.keyreleased then