fix(bw): LONG press RTN to exit Lua script closes tools menu (#5417)
This commit is contained in:
@@ -1049,6 +1049,7 @@ static bool resumeLua(bool init, bool allowLcdUsage)
|
|||||||
luaNextEvent(&evt);
|
luaNextEvent(&evt);
|
||||||
if (evt.event == EVT_KEY_LONG(KEY_EXIT)) {
|
if (evt.event == EVT_KEY_LONG(KEY_EXIT)) {
|
||||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||||
|
killEvents(evt.event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1214,12 +1215,14 @@ static bool resumeLua(bool init, bool allowLcdUsage)
|
|||||||
TRACE("Script force exit");
|
TRACE("Script force exit");
|
||||||
luaEmptyEventBuffer();
|
luaEmptyEventBuffer();
|
||||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||||
|
killEvents(evt.event);
|
||||||
}
|
}
|
||||||
#if defined(KEYS_GPIO_REG_MENU)
|
#if defined(KEYS_GPIO_REG_MENU)
|
||||||
// TODO find another key and add a #define
|
// TODO find another key and add a #define
|
||||||
else if (evt.event == EVT_KEY_LONG(KEY_MENU)) {
|
else if (evt.event == EVT_KEY_LONG(KEY_MENU)) {
|
||||||
luaEmptyEventBuffer();
|
luaEmptyEventBuffer();
|
||||||
luaDisplayStatistics = !luaDisplayStatistics;
|
luaDisplayStatistics = !luaDisplayStatistics;
|
||||||
|
killEvents(evt.event);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user