Use EVT_KEY_FIRST(KEY_EXIT) instead of EVT_KEY_BREAK() in FormGroup

This prevents the TabGroup from catching the event first, and thus quit the complete page.
Resolves EdgeTX/edgetx#164
This commit is contained in:
Raphael Coeffic
2021-06-09 07:22:33 +02:00
parent d535136648
commit 76a3886a03
+7 -9
View File
@@ -225,20 +225,18 @@ void FormGroup::onEvent(event_t event)
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
onKeyPress();
setFocusOnFirstVisibleField(SET_FOCUS_FIRST);
}
else if (event == EVT_KEY_BREAK(KEY_EXIT) && !hasFocus() && !(windowFlags & FORM_FORWARD_FOCUS)) {
} else if (event == EVT_KEY_FIRST(KEY_EXIT) && !hasFocus() &&
!(windowFlags & FORM_FORWARD_FOCUS)) {
killEvents(event);
onKeyPress();
setFocus(SET_FOCUS_DEFAULT); // opentx - model - timers settings
}
else if (event == EVT_ROTARY_RIGHT && !next) {
setFocus(SET_FOCUS_DEFAULT); // opentx - model - timers settings
} else if (event == EVT_ROTARY_RIGHT && !next) {
onKeyPress();
setFocusOnFirstVisibleField(SET_FOCUS_FIRST);
}
else if (event == EVT_ROTARY_LEFT && !previous) {
} else if (event == EVT_ROTARY_LEFT && !previous) {
onKeyPress();
setFocusOnLastVisibleField(SET_FOCUS_BACKWARD);
}
else {
} else {
FormField::onEvent(event);
}
}