mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
rename android_back to back_handler
This commit is contained in:
27
druid/base/back_handler.lua
Normal file
27
druid/base/back_handler.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
local data = require("druid.data")
|
||||
|
||||
local M = {}
|
||||
M.interest = {
|
||||
data.ON_INPUT
|
||||
}
|
||||
|
||||
|
||||
function M.init(self, callback, params)
|
||||
self.event = data.A_ANDR_BACK
|
||||
self.callback = callback
|
||||
self.params = params
|
||||
end
|
||||
|
||||
|
||||
--- input handler
|
||||
-- @param action_id - input action id
|
||||
-- @param action - input action
|
||||
function M.on_input(self, action_id, action)
|
||||
if action[data.RELEASED] then
|
||||
self.callback(self.parent.parent, self.params)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return M
|
Reference in New Issue
Block a user