From c2451085eca32e8b8f984afe19ba5f3da1201049 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Mon, 26 Sep 2022 01:49:51 +0200 Subject: [PATCH] fix(lua): handle ENTER_LONG properly (#2353) Fixes #2267 --- radio/src/lua/lua_widget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/radio/src/lua/lua_widget.cpp b/radio/src/lua/lua_widget.cpp index 99e72b25c..a49d89631 100644 --- a/radio/src/lua/lua_widget.cpp +++ b/radio/src/lua/lua_widget.cpp @@ -51,6 +51,11 @@ void LuaEventHandler::event_cb(lv_event_t* e) win->onEvent(EVT_ROTARY_RIGHT); } } + else if (code == LV_EVENT_LONG_PRESSED) { + // Do not use `lv_indev_wait_release()` as some LUA scripts + // rely on EVT_KEY_BREAK(KEY_ENTER) being generated on key release + luaPushEvent(EVT_KEY_LONG(KEY_ENTER)); + } #if defined(HARDWARE_TOUCH) else if (code == LV_EVENT_PRESSED || code == LV_EVENT_PRESSING) {