diff options
Diffstat (limited to 'src/input/lvgl_input_driver.cpp')
| -rw-r--r-- | src/input/lvgl_input_driver.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/input/lvgl_input_driver.cpp b/src/input/lvgl_input_driver.cpp index 9698aa79..61a85fa5 100644 --- a/src/input/lvgl_input_driver.cpp +++ b/src/input/lvgl_input_driver.cpp @@ -16,6 +16,8 @@ #include "input_touch_wheel.hpp" #include "input_trigger.hpp" #include "input_volume_buttons.hpp" +#include "lauxlib.h" +#include "lua.h" #include "lvgl.h" #include "nvs.hpp" #include "property.hpp" @@ -104,4 +106,22 @@ auto LvglInputDriver::feedback(uint8_t event) -> void { } } +auto LvglInputDriver::pushHooks(lua_State* L) -> int { + lua_newtable(L); + + for (auto& dev : inputs_) { + lua_pushlstring(L, dev->name().data(), dev->name().size()); + lua_newtable(L); + + for (auto& hook : dev->hooks()) { + lua_pushlstring(L, hook.name().data(), hook.name().size()); + hook.pushHooks(L); + lua_rawset(L, -3); + } + + lua_rawset(L, -3); + } + return 1; +} + } // namespace input |
