Add more events on button (long_tap, repeated_tap, double_tap)

This commit is contained in:
Insality
2020-02-24 23:36:44 +03:00
parent b1fbb7c5bf
commit 162bbd0ed9
6 changed files with 122 additions and 10 deletions

View File

@@ -43,6 +43,21 @@ function M.unsubscribe(self, callback)
end
--- Return true, if event have at lease one handler
-- @function event:is_exist
-- @treturn boolean True if event have handlers
function M.is_exist(self)
return #self._callbacks > 0
end
--- Clear the all event handlers
-- @function event:clear
function M.clear(self)
self._callbacks = {}
end
--- Trigger the event and call all subscribed callbacks
-- @function event:trigger
-- @param ... All event params