fix(lua): ignore potential unwanted key events (#4833)

This commit is contained in:
philmoz
2024-04-02 10:52:17 +10:00
committed by GitHub
parent 9357e2d8b8
commit 0d84acef59
2 changed files with 11 additions and 1 deletions
+10 -1
View File
@@ -438,7 +438,16 @@ bool handleGui(event_t event) {
menuHandlers[menuLevel] == menuViewTelemetry &&
TELEMETRY_SCREEN_TYPE(s_frsky_view) == TELEMETRY_SCREEN_TYPE_SCRIPT;
bool isStandalone = scriptInternalData[0].reference == SCRIPT_STANDALONE;
if (isTelemView || isStandalone) luaPushEvent(event);
if ((isTelemView || isStandalone) && event) {
#if !defined(KEYS_GPIO_REG_PAGEUP)
// For radios with a single PAGE key, kill the
// EVT_KEY_BREAK event after a long press of the PAGE key.
if (event == EVT_KEY_LONG(KEY_PAGE)) {
killEvents(KEY_PAGE);
}
#endif
luaPushEvent(event);
}
refreshNeeded = luaTask(true);
if (isTelemView)
menuHandlers[menuLevel](event);