refactor: key handling (#4849)

This commit is contained in:
philmoz
2024-05-27 18:33:53 +10:00
committed by GitHub
parent b8a0038c68
commit e807ccbebf
101 changed files with 380 additions and 578 deletions
+2 -4
View File
@@ -76,10 +76,9 @@ void menuModelFlightModesAll(event_t event)
drawFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, mixerCurrentFlightMode+1);
if (sub == MAX_FLIGHT_MODES) {
if (!trimsCheckTimer) {
if (event == EVT_KEY_FIRST(KEY_ENTER)) {
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
trimsCheckTimer = 200; // 2 seconds trims cancelled
s_editMode = 1;
killEvents(event);
}
else {
lcdInvertLastLine();
@@ -87,10 +86,9 @@ void menuModelFlightModesAll(event_t event)
}
}
else {
if (event == EVT_KEY_FIRST(KEY_EXIT)) {
if (event == EVT_KEY_BREAK(KEY_EXIT)) {
trimsCheckTimer = 0;
s_editMode = 0;
killEvents(event);
}
}
}