Skip to content

Commit

Permalink
Update keyboard.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jul 16, 2020
1 parent 3aaa6a9 commit ee0659e
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions src/eez/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,26 @@ void onKeyDown(uint16_t param) {
} else if (key == KEY_PRINTSCREEN) {
takeScreenshot();
} else {
if (!handled) {
if (key >= KEY_1_EXCLAMATION_MARK && key <= KEY_0_CPARENTHESIS) {
if (getActivePageId() == PAGE_ID_MAIN) {
int channelIndex = key - KEY_1_EXCLAMATION_MARK;
if (channelIndex < CH_MAX) {
using namespace psu;
auto &channel = Channel::get(channelIndex);
selectChannel(&channel);
clearFoundWidgetAtDown();
channelToggleOutput();
}
if (key >= KEY_1_EXCLAMATION_MARK && key <= KEY_0_CPARENTHESIS) {
if (getActivePageId() == PAGE_ID_MAIN) {
int channelIndex = key - KEY_1_EXCLAMATION_MARK;
if (channelIndex < CH_MAX) {
using namespace psu;
auto &channel = Channel::get(channelIndex);
selectChannel(&channel);
clearFoundWidgetAtDown();
channelToggleOutput();
}
} else if (key == KEY_HOME) {
goBack();
} else if (key == KEY_ESCAPE) {
popPage();
} else if (key == KEY_SPACEBAR || key == KEY_ENTER) {
if (g_focusWidgetCursor) {
if (g_focusWidgetCursor.widget->action) {
setFoundWidgetAtDown(g_focusWidgetCursor);
executeAction(g_focusWidgetCursor.widget->action);
}
}
} else if (key == KEY_HOME) {
goBack();
} else if (key == KEY_ESCAPE) {
popPage();
} else if (key == KEY_SPACEBAR || key == KEY_ENTER) {
if (g_focusWidgetCursor) {
if (g_focusWidgetCursor.widget->action) {
setFoundWidgetAtDown(g_focusWidgetCursor);
executeAction(g_focusWidgetCursor.widget->action);
}
}
}
Expand Down

0 comments on commit ee0659e

Please sign in to comment.