More beeps
This commit is contained in:
+11
-1
@@ -39,19 +39,23 @@ void FormField::onEvent(event_t event)
|
|||||||
|
|
||||||
if (event == EVT_ROTARY_RIGHT/*EVT_KEY_BREAK(KEY_DOWN)*/) {
|
if (event == EVT_ROTARY_RIGHT/*EVT_KEY_BREAK(KEY_DOWN)*/) {
|
||||||
if (next) {
|
if (next) {
|
||||||
|
onKeyPress();
|
||||||
next->setFocus(SET_FOCUS_FORWARD);
|
next->setFocus(SET_FOCUS_FORWARD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event == EVT_ROTARY_LEFT/*EVT_KEY_BREAK(KEY_UP)*/) {
|
else if (event == EVT_ROTARY_LEFT/*EVT_KEY_BREAK(KEY_UP)*/) {
|
||||||
if (previous) {
|
if (previous) {
|
||||||
|
onKeyPress();
|
||||||
previous->setFocus(SET_FOCUS_BACKWARD);
|
previous->setFocus(SET_FOCUS_BACKWARD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
else if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
|
onKeyPress();
|
||||||
setEditMode(!editMode);
|
setEditMode(!editMode);
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
else if (event == EVT_KEY_BREAK(KEY_EXIT) && editMode) {
|
else if (event == EVT_KEY_BREAK(KEY_EXIT) && editMode) {
|
||||||
|
onKeyPress();
|
||||||
setEditMode(false);
|
setEditMode(false);
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
@@ -210,15 +214,19 @@ void FormGroup::onEvent(event_t event)
|
|||||||
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("FormGroup").c_str(), event);
|
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("FormGroup").c_str(), event);
|
||||||
|
|
||||||
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
|
onKeyPress();
|
||||||
setFocusOnFirstVisibleField(SET_FOCUS_FIRST);
|
setFocusOnFirstVisibleField(SET_FOCUS_FIRST);
|
||||||
}
|
}
|
||||||
else if (event == EVT_KEY_BREAK(KEY_EXIT) && !hasFocus() && !(windowFlags & FORM_FORWARD_FOCUS)) {
|
else if (event == EVT_KEY_BREAK(KEY_EXIT) && !hasFocus() && !(windowFlags & FORM_FORWARD_FOCUS)) {
|
||||||
|
onKeyPress();
|
||||||
setFocus(SET_FOCUS_DEFAULT); // opentx - model - timers settings
|
setFocus(SET_FOCUS_DEFAULT); // opentx - model - timers settings
|
||||||
}
|
}
|
||||||
else if (event == EVT_ROTARY_RIGHT && !next) {
|
else if (event == EVT_ROTARY_RIGHT && !next) {
|
||||||
|
onKeyPress();
|
||||||
setFocusOnFirstVisibleField(SET_FOCUS_FIRST);
|
setFocusOnFirstVisibleField(SET_FOCUS_FIRST);
|
||||||
}
|
}
|
||||||
else if (event == EVT_ROTARY_LEFT && !previous) {
|
else if (event == EVT_ROTARY_LEFT && !previous) {
|
||||||
|
onKeyPress();
|
||||||
setFocusOnLastVisibleField(SET_FOCUS_BACKWARD);
|
setFocusOnLastVisibleField(SET_FOCUS_BACKWARD);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -245,10 +253,12 @@ void FormWindow::onEvent(event_t event)
|
|||||||
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("FormWindow").c_str(), event);
|
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("FormWindow").c_str(), event);
|
||||||
|
|
||||||
if (event == EVT_KEY_BREAK(KEY_EXIT) && (windowFlags & FORM_FORWARD_FOCUS) && first) {
|
if (event == EVT_KEY_BREAK(KEY_EXIT) && (windowFlags & FORM_FORWARD_FOCUS) && first) {
|
||||||
|
onKeyPress();
|
||||||
Window * currentFocus = getFocus();
|
Window * currentFocus = getFocus();
|
||||||
first->setFocus(SET_FOCUS_FIRST);
|
first->setFocus(SET_FOCUS_FIRST);
|
||||||
if (getFocus() != currentFocus)
|
if (getFocus() != currentFocus) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FormGroup::onEvent(event);
|
FormGroup::onEvent(event);
|
||||||
|
|||||||
+11
-3
@@ -36,15 +36,20 @@ void MenuBody::onEvent(event_t event)
|
|||||||
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString().c_str(), event);
|
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString().c_str(), event);
|
||||||
|
|
||||||
if (event == EVT_ROTARY_RIGHT) {
|
if (event == EVT_ROTARY_RIGHT) {
|
||||||
if (!lines.empty())
|
if (!lines.empty()) {
|
||||||
select(int((selectedIndex + 1) % lines.size()));
|
select(int((selectedIndex + 1) % lines.size()));
|
||||||
|
onKeyPress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (event == EVT_ROTARY_LEFT) {
|
else if (event == EVT_ROTARY_LEFT) {
|
||||||
if (!lines.empty())
|
if (!lines.empty()) {
|
||||||
select(int(selectedIndex <= 0 ? lines.size() - 1 : selectedIndex - 1));
|
select(int(selectedIndex <= 0 ? lines.size() - 1 : selectedIndex - 1));
|
||||||
|
onKeyPress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
else if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
if (!lines.empty()) {
|
if (!lines.empty()) {
|
||||||
|
onKeyPress();
|
||||||
if (selectedIndex < 0) {
|
if (selectedIndex < 0) {
|
||||||
select(0);
|
select(0);
|
||||||
}
|
}
|
||||||
@@ -62,8 +67,10 @@ void MenuBody::onEvent(event_t event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event == EVT_KEY_BREAK(KEY_EXIT)) {
|
else if (event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||||
if (onCancel)
|
onKeyPress();
|
||||||
|
if (onCancel) {
|
||||||
onCancel();
|
onCancel();
|
||||||
|
}
|
||||||
Window::onEvent(event);
|
Window::onEvent(event);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -78,6 +85,7 @@ bool MenuBody::onTouchEnd(coord_t /*x*/, coord_t y)
|
|||||||
Menu * menu = getParentMenu();
|
Menu * menu = getParentMenu();
|
||||||
int index = y / MENUS_LINE_HEIGHT;
|
int index = y / MENUS_LINE_HEIGHT;
|
||||||
if (index < (int)lines.size()) {
|
if (index < (int)lines.size()) {
|
||||||
|
onKeyPress();
|
||||||
if (menu->multiple) {
|
if (menu->multiple) {
|
||||||
if (selectedIndex == index)
|
if (selectedIndex == index)
|
||||||
lines[index].onPress();
|
lines[index].onPress();
|
||||||
|
|||||||
Reference in New Issue
Block a user