Merge pull request #3 from EdgeTX/fix-164

Use EVT_KEY_FIRST(KEY_EXIT) instead of EVT_KEY_BREAK() in FormGroup
This commit is contained in:
Raphael Coeffic
2021-06-10 15:27:44 +02:00
committed by GitHub
+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);
}
}