From 8443b50aef09eed265b4015544944ed71e59c930 Mon Sep 17 00:00:00 2001 From: philmoz Date: Mon, 12 Aug 2024 10:37:02 +1000 Subject: [PATCH] fix(bw): LONG press RTN to exit Lua script closes tools menu (#5417) --- radio/src/lua/interface.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radio/src/lua/interface.cpp b/radio/src/lua/interface.cpp index 56a3b588090..bb5fb699363 100644 --- a/radio/src/lua/interface.cpp +++ b/radio/src/lua/interface.cpp @@ -1049,6 +1049,7 @@ static bool resumeLua(bool init, bool allowLcdUsage) luaNextEvent(&evt); if (evt.event == EVT_KEY_LONG(KEY_EXIT)) { luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS; + killEvents(evt.event); } } @@ -1214,12 +1215,14 @@ static bool resumeLua(bool init, bool allowLcdUsage) TRACE("Script force exit"); luaEmptyEventBuffer(); luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS; + killEvents(evt.event); } #if defined(KEYS_GPIO_REG_MENU) // TODO find another key and add a #define else if (evt.event == EVT_KEY_LONG(KEY_MENU)) { luaEmptyEventBuffer(); luaDisplayStatistics = !luaDisplayStatistics; + killEvents(evt.event); } #endif }