diff options
Diffstat (limited to 'src/input/input_hook.cpp')
| -rw-r--r-- | src/input/input_hook.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/input/input_hook.cpp b/src/input/input_hook.cpp index 1bb92196..48d6c2a4 100644 --- a/src/input/input_hook.cpp +++ b/src/input/input_hook.cpp @@ -85,23 +85,8 @@ auto TriggerHooks::name() const -> const std::string& { return name_; } -auto TriggerHooks::pushHooks(lua_State* L) -> void { - lua_newtable(L); - - auto add_trigger = [&](Hook& h) { - lua_pushlstring(L, h.name().data(), h.name().size()); - auto cb = h.callback(); - if (cb) { - lua_pushlstring(L, cb->name.data(), cb->name.size()); - } else { - lua_pushnil(L); - } - lua_rawset(L, -3); - }; - - add_trigger(click_); - add_trigger(long_press_); - add_trigger(repeat_); +auto TriggerHooks::hooks() -> std::vector<std::reference_wrapper<Hook>> { + return {click_, long_press_, repeat_}; } } // namespace input |
