Fix some keys no sent to telemetry screens handler (#7263)

Fix some keys no sent to telemetry screens handler
This commit is contained in:
3djc
2020-01-06 11:25:42 +01:00
committed by Bertrand Songis
parent 838bd2f6a0
commit abb1cd473b
2 changed files with 30 additions and 57 deletions
-15
View File
@@ -381,21 +381,6 @@ void handleGui(event_t event) {
}
else if (luaTask(event, RUN_TELEM_FG_SCRIPT, true)) {
// the telemetry screen is active
// prevent events from keys MENU, UP, DOWN, ENT(short) and EXIT(short) from reaching the normal menus,
// so Lua telemetry script can fully use them
if (event) {
uint8_t key = EVT_KEY_MASK(event);
#if defined(PCBXLITE)
// SHIFT + LEFT/RIGHT LONG used to change telemetry screen on XLITE
if ((!IS_KEY_LONG(event) && key == KEY_RIGHT && IS_SHIFT_PRESSED()) || (!IS_KEY_LONG(event) && key == KEY_LEFT && IS_SHIFT_PRESSED()) || (!IS_KEY_LONG(event) && key == KEY_EXIT)) {
#else
// no need to filter out MENU and ENT(short), because they are not used by menuViewTelemetryFrsky()
if (key == KEY_PLUS || key == KEY_MINUS || (!IS_KEY_LONG(event) && key == KEY_EXIT)) {
#endif
// TRACE("Telemetry script event 0x%02x killed", event);
event = 0;
}
}
menuHandlers[menuLevel](event);
}
else