From 7e455374022eabeeed82a22fe466b28d8601180a Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 15 Mar 2016 23:21:32 +0100 Subject: [PATCH] [Horus] Keymap is now consistent with labels on keys --- radio/src/gui/horus/menu_model_curves.cpp | 7 ++- .../src/gui/horus/menu_model_flightmodes.cpp | 2 +- radio/src/gui/horus/menu_model_inputs.cpp | 30 +++------ radio/src/gui/horus/menu_model_limits.cpp | 12 ++-- radio/src/gui/horus/menu_model_mixes.cpp | 30 +++------ radio/src/gui/horus/navigation.cpp | 59 ++++-------------- radio/src/gui/horus/popups.cpp | 4 -- radio/src/gui/horus/view_about.cpp | 4 +- radio/src/gui/horus/view_main.cpp | 8 +-- radio/src/keys.h | 62 ++++++++++--------- radio/src/lua/api_general.cpp | 2 + radio/src/lua/interface.cpp | 3 + radio/src/simu.cpp | 4 +- radio/src/targets/horus/keys_driver.cpp | 12 ++-- radio/src/targets/simu/simpgmspace.cpp | 12 ++-- 15 files changed, 99 insertions(+), 152 deletions(-) diff --git a/radio/src/gui/horus/menu_model_curves.cpp b/radio/src/gui/horus/menu_model_curves.cpp index ece0ad699..326915f2a 100644 --- a/radio/src/gui/horus/menu_model_curves.cpp +++ b/radio/src/gui/horus/menu_model_curves.cpp @@ -205,9 +205,10 @@ bool menuModelCurveOne(evt_t event) popupMenuHandler = onCurveOneMenu; } break; - case EVT_KEY_LONG(KEY_MENU): - pushMenu(menuChannelsView); - killEvents(event); + // TODO? + // case EVT_KEY_LONG(KEY_MENU): + // pushMenu(menuChannelsView); + // killEvents(event); } drawCurve(CURVE_CENTER_X, CURVE_CENTER_Y, CURVE_SIDE_WIDTH); diff --git a/radio/src/gui/horus/menu_model_flightmodes.cpp b/radio/src/gui/horus/menu_model_flightmodes.cpp index 3d2f2a448..d5b11fc4d 100644 --- a/radio/src/gui/horus/menu_model_flightmodes.cpp +++ b/radio/src/gui/horus/menu_model_flightmodes.cpp @@ -19,7 +19,7 @@ */ #include -#include "../../opentx.h" +#include "opentx.h" void displayFlightModes(coord_t x, coord_t y, FlightModesType value, uint8_t attr) { diff --git a/radio/src/gui/horus/menu_model_inputs.cpp b/radio/src/gui/horus/menu_model_inputs.cpp index 069cec51b..58458fb93 100644 --- a/radio/src/gui/horus/menu_model_inputs.cpp +++ b/radio/src/gui/horus/menu_model_inputs.cpp @@ -19,7 +19,7 @@ */ #include -#include "../../opentx.h" +#include "opentx.h" #define EXPO_ONE_2ND_COLUMN 110 @@ -450,41 +450,27 @@ bool menuModelExposAll(evt_t event) } } break; - case EVT_KEY_LONG(KEY_LEFT): - case EVT_KEY_LONG(KEY_RIGHT): - if (s_copyMode && !s_copyTgtOfs) { - if (reachExposLimit()) break; - s_currCh = chn; - if (event == EVT_KEY_LONG(KEY_RIGHT)) { s_currIdx++; menuVerticalPosition++; } - insertExpo(s_currIdx); - pushMenu(menuModelExpoOne); - s_copyMode = 0; - killEvents(event); - } - break; - case EVT_KEY_FIRST(KEY_UP): - case EVT_KEY_REPT(KEY_UP): - case EVT_KEY_FIRST(KEY_DOWN): - case EVT_KEY_REPT(KEY_DOWN): + + case EVT_ROTARY_LEFT: + case EVT_ROTARY_RIGHT: if (s_copyMode) { - uint8_t key = (event & 0x1f); - uint8_t next_ofs = ((event==EVT_ROTARY_LEFT || key==KEY_UP) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1); + uint8_t next_ofs = ((event==EVT_ROTARY_LEFT) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1); if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) { // insert a mix on the same channel (just above / just below) if (reachExposLimit()) break; copyExpo(s_currIdx); - if (event==EVT_ROTARY_RIGHT || key==KEY_DOWN) s_currIdx++; + if (event==EVT_ROTARY_RIGHT) s_currIdx++; else if (sub-menuVerticalOffset >= 6) menuVerticalOffset++; } else if (next_ofs==0 && s_copyMode==COPY_MODE) { // delete the mix deleteExpo(s_currIdx); - if (event==EVT_ROTARY_LEFT || key==KEY_UP) s_currIdx--; + if (event==EVT_ROTARY_LEFT) s_currIdx--; } else { // only swap the mix with its neighbor - if (!swapExpos(s_currIdx, event==EVT_ROTARY_LEFT || key==KEY_UP)) break; + if (!swapExpos(s_currIdx, event==EVT_ROTARY_LEFT)) break; storageDirty(EE_MODEL); } diff --git a/radio/src/gui/horus/menu_model_limits.cpp b/radio/src/gui/horus/menu_model_limits.cpp index 799b7b20b..7331a7750 100644 --- a/radio/src/gui/horus/menu_model_limits.cpp +++ b/radio/src/gui/horus/menu_model_limits.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. */ -#include "../../opentx.h" +#include "opentx.h" bool isThrottleOutput(uint8_t ch) { @@ -176,10 +176,12 @@ bool menuModelLimits(evt_t event) if (active) { ld->offset = checkIncDec(event, ld->offset, -1000, 1000, EE_MODEL, NULL, stops1000); } - else if (attr && event==EVT_KEY_LONG(KEY_MENU)) { - copySticksToOffset(k); - s_editMode = 0; - } + + // TODO with the contextual menu I think + // else if (attr && event==EVT_KEY_LONG(KEY_MENU)) { + // copySticksToOffset(k); + // s_editMode = 0; + // } break; case ITEM_LIMITS_MIN: diff --git a/radio/src/gui/horus/menu_model_mixes.cpp b/radio/src/gui/horus/menu_model_mixes.cpp index 28dd2e1b5..203c45ff2 100644 --- a/radio/src/gui/horus/menu_model_mixes.cpp +++ b/radio/src/gui/horus/menu_model_mixes.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. */ -#include "../../opentx.h" +#include "opentx.h" #include int getMixesLinesCount() @@ -421,41 +421,27 @@ bool menuModelMixAll(evt_t event) } } break; - case EVT_KEY_LONG(KEY_LEFT): - case EVT_KEY_LONG(KEY_RIGHT): - if (s_copyMode && !s_copyTgtOfs) { - if (reachMixesLimit()) break; - s_currCh = chn; - if (event == EVT_KEY_LONG(KEY_RIGHT)) { s_currIdx++; menuVerticalPosition++; } - insertMix(s_currIdx); - pushMenu(menuModelMixOne); - s_copyMode = 0; - killEvents(event); - } - break; - case EVT_KEY_FIRST(KEY_UP): - case EVT_KEY_REPT(KEY_UP): - case EVT_KEY_FIRST(KEY_DOWN): - case EVT_KEY_REPT(KEY_DOWN): + + case EVT_ROTARY_RIGHT: + case EVT_ROTARY_LEFT: if (s_copyMode) { - uint8_t key = (event & 0x1f); - uint8_t next_ofs = ((event==EVT_ROTARY_LEFT || key==KEY_UP) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1); + uint8_t next_ofs = (event==EVT_ROTARY_LEFT ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1); if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) { // insert a mix on the same channel (just above / just below) if (reachMixesLimit()) break; copyMix(s_currIdx); - if (event==EVT_ROTARY_RIGHT || key==KEY_DOWN) s_currIdx++; + if (event==EVT_ROTARY_RIGHT) s_currIdx++; else if (sub-menuVerticalOffset >= 6) menuVerticalOffset++; } else if (next_ofs==0 && s_copyMode==COPY_MODE) { // delete the mix deleteMix(s_currIdx); - if (event==EVT_ROTARY_LEFT || key==KEY_UP) s_currIdx--; + if (event==EVT_ROTARY_LEFT) s_currIdx--; } else { // only swap the mix with its neighbor - if (!swapMixes(s_currIdx, event==EVT_ROTARY_LEFT || key==KEY_UP)) break; + if (!swapMixes(s_currIdx, event==EVT_ROTARY_LEFT)) break; storageDirty(EE_MODEL); } diff --git a/radio/src/gui/horus/navigation.cpp b/radio/src/gui/horus/navigation.cpp index 2feb3b9b0..fca97dd51 100644 --- a/radio/src/gui/horus/navigation.cpp +++ b/radio/src/gui/horus/navigation.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. */ -#include "../../opentx.h" +#include "opentx.h" int menuVerticalOffset; int menuVerticalPosition; @@ -411,32 +411,33 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u { uint8_t maxcol = MAXCOL(menuVerticalPosition); - if (menuTab && !calibrationState && menuVerticalPosition<0) { + if (menuTab && !calibrationState) { int cc = curr; switch (event) { - case EVT_KEY_BREAK(KEY_RIGHT): case EVT_ROTARY_RIGHT: + if (menuVerticalPosition >= 0) + break; + // no break + case EVT_KEY_BREAK(KEY_PGDN): if (++cc == menuTabSize) cc = 0; break; - case EVT_KEY_BREAK(KEY_LEFT): case EVT_ROTARY_LEFT: + if (menuVerticalPosition >= 0) + break; + // no break + case EVT_KEY_BREAK(KEY_PGUP): if (cc-- == 0) cc = menuTabSize-1; break; case EVT_KEY_BREAK(KEY_ENTER): - if (rowcount > 0) { + if (menuVerticalPosition < 0 && rowcount > 0) { menuVerticalPosition = MENU_FIRST_LINE_EDIT; event = 0; } break; - - case EVT_KEY_BREAK(KEY_DOWN): - case EVT_KEY_BREAK(KEY_UP): - menuHorizontalPosition = -1; - break; } if (cc != curr) { @@ -537,24 +538,6 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u menuHorizontalPosition = POS_HORZ_INIT(menuVerticalPosition); break; - case EVT_KEY_FIRST(KEY_DOWN): - case EVT_KEY_REPT(KEY_DOWN): - { - do { - INC(menuVerticalPosition, MENU_FIRST_LINE_EDIT, rowcount-1); - } while (CURSOR_NOT_ALLOWED_IN_ROW(menuVerticalPosition)); - - s_editMode = 0; // if we go down, we must be in this mode - uint8_t newmaxcol = MAXCOL(menuVerticalPosition); - if (COLATTR(menuVerticalPosition) & NAVIGATION_LINE_BY_LINE) { - menuHorizontalPosition = -1; - } - else if (menuHorizontalPosition < 0 || menuHorizontalPosition > newmaxcol) { - menuHorizontalPosition = POS_HORZ_INIT(menuVerticalPosition); - } - break; - } - case EVT_ROTARY_LEFT: if (s_editMode != 0) break; if ((COLATTR(menuVerticalPosition) & NAVIGATION_LINE_BY_LINE)) { @@ -575,26 +558,6 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u else menuHorizontalPosition = MAXCOL(menuVerticalPosition); break; - - case EVT_KEY_FIRST(KEY_UP): - case EVT_KEY_REPT(KEY_UP): - { - do { - DEC(menuVerticalPosition, MENU_FIRST_LINE_EDIT, rowcount-1); - } while (CURSOR_NOT_ALLOWED_IN_ROW(menuVerticalPosition)); - s_editMode = 0; // if we go up, we must be in this mode - uint8_t newmaxcol = MAXCOL(menuVerticalPosition); - if ((COLATTR(menuVerticalPosition) & NAVIGATION_LINE_BY_LINE)) { - menuHorizontalPosition = -1; - } - else if (menuHorizontalPosition < 0) { - menuHorizontalPosition = POS_HORZ_INIT(menuVerticalPosition); - } - else if (menuHorizontalPosition > newmaxcol) { - menuHorizontalPosition = min((uint8_t)menuHorizontalPosition, newmaxcol); - } - break; - } } linesCount = rowcount; diff --git a/radio/src/gui/horus/popups.cpp b/radio/src/gui/horus/popups.cpp index 787a16ee9..1c97a7dff 100644 --- a/radio/src/gui/horus/popups.cpp +++ b/radio/src/gui/horus/popups.cpp @@ -107,8 +107,6 @@ const char * displayPopupMenu(evt_t event) switch (event) { case EVT_ROTARY_LEFT: - case EVT_KEY_FIRST(KEY_UP): - case EVT_KEY_REPT(KEY_UP): if (s_menu_item > 0) { s_menu_item--; } @@ -126,8 +124,6 @@ const char * displayPopupMenu(evt_t event) break; case EVT_ROTARY_RIGHT: - case EVT_KEY_FIRST(KEY_DOWN): - case EVT_KEY_REPT(KEY_DOWN): if (s_menu_item < display_count - 1 && popupMenuOffset + s_menu_item + 1 < popupMenuNoItems) { s_menu_item++; } diff --git a/radio/src/gui/horus/view_about.cpp b/radio/src/gui/horus/view_about.cpp index 1fc350b89..620ae172f 100644 --- a/radio/src/gui/horus/view_about.cpp +++ b/radio/src/gui/horus/view_about.cpp @@ -49,11 +49,11 @@ bool menuAboutView(evt_t event) screenIndex = 0; greyIndex = 0; break; - case EVT_KEY_FIRST(KEY_DOWN): + case EVT_KEY_FIRST(KEY_RIGHT): screenIndex < ABOUT_PARENTS ? screenIndex++ : screenIndex = ABOUT_OPENTX; greyIndex = 0; break; - case EVT_KEY_FIRST(KEY_UP): + case EVT_KEY_FIRST(KEY_LEFT): screenIndex > ABOUT_OPENTX ? screenIndex-- : screenIndex = ABOUT_PARENTS; greyIndex = 0; break; diff --git a/radio/src/gui/horus/view_main.cpp b/radio/src/gui/horus/view_main.cpp index a7d6b8b02..361d59c4a 100644 --- a/radio/src/gui/horus/view_main.cpp +++ b/radio/src/gui/horus/view_main.cpp @@ -154,21 +154,21 @@ bool menuMainView(evt_t event) popupMenuHandler = onMainViewMenu; break; - case EVT_KEY_BREAK(KEY_MENU): + case EVT_KEY_BREAK(KEY_MODEL): pushMenu(menuTabModel[0]); break; - case EVT_KEY_LONG(KEY_MENU): + case EVT_KEY_BREAK(KEY_RADIO): killEvents(event); pushMenu(menuTabGeneral[0]); break; - case EVT_KEY_BREAK(KEY_DOWN): + case EVT_KEY_BREAK(KEY_PGDN): storageDirty(EE_GENERAL); g_eeGeneral.view = circularIncDec(g_eeGeneral.view, +1, 0, getMainViewsCount()-1); break; - case EVT_KEY_BREAK(KEY_UP): + case EVT_KEY_BREAK(KEY_PGUP): killEvents(event); storageDirty(EE_GENERAL); g_eeGeneral.view = circularIncDec(g_eeGeneral.view, -1, 0, getMainViewsCount()-1); diff --git a/radio/src/keys.h b/radio/src/keys.h index ad11206b0..30f5233f9 100644 --- a/radio/src/keys.h +++ b/radio/src/keys.h @@ -1,35 +1,39 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef _KEYS_H_ -#define _KEYS_H_ +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _KEYS_H_ +#define _KEYS_H_ enum EnumKeys { #if defined(PCBHORUS) - KEY_MENU, - KEY_EXIT, + KEY_PGUP, + KEY_PGDN, KEY_ENTER, - KEY_UP, - KEY_DOWN, - KEY_RIGHT, - KEY_LEFT, + KEY_MODEL, + KEY_UP=KEY_MODEL, + KEY_EXIT, + KEY_DOWN=KEY_EXIT, + KEY_TELEM, + KEY_RIGHT=KEY_TELEM, + KEY_RADIO, + KEY_LEFT=KEY_RADIO, #elif defined(PCBFLAMENCO) KEY_MENU, KEY_EXIT, @@ -273,4 +277,4 @@ void killEvents(uint8_t enuk); uint8_t keyDown(); -#endif // _KEYS_H_ +#endif // _KEYS_H_ diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index 1a8ab9640..fbb75cdd4 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -863,7 +863,9 @@ const luaR_value_entry opentxConstants[] = { { "MIXSRC_SH", MIXSRC_SH }, { "MIXSRC_CH1", MIXSRC_CH1 }, { "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH }, +#if !defined(PCBHORUS) { "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU) }, +#endif #if defined(COLORLCD) { "COLOR", ZoneOption::Color }, { "TEXT_COLOR_INDEX", TEXT_COLOR_INDEX }, diff --git a/radio/src/lua/interface.cpp b/radio/src/lua/interface.cpp index 237dce88e..42e446446 100644 --- a/radio/src/lua/interface.cpp +++ b/radio/src/lua/interface.cpp @@ -588,10 +588,13 @@ void luaDoOneRunStandalone(evt_t evt) standaloneScript.state = SCRIPT_NOFILE; luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS; } +#if !defined(PCBHORUS) + // TODO find another key and add a #define else if (evt == EVT_KEY_LONG(KEY_MENU)) { killEvents(evt); luaDisplayStatistics = !luaDisplayStatistics; } +#endif } } diff --git a/radio/src/simu.cpp b/radio/src/simu.cpp index e2064c7f6..911eb7f52 100644 --- a/radio/src/simu.cpp +++ b/radio/src/simu.cpp @@ -229,9 +229,9 @@ void Open9xSim::updateKeysAndSwitches(bool start) { static int keys1[] = { #if defined(PCBHORUS) - KEY_Page_Up, KEY_MENU, + KEY_Page_Up, KEY_PGUP, + KEY_Page_Down, KEY_PGDN, KEY_Return, KEY_ENTER, - KEY_BackSpace, KEY_EXIT, KEY_Up, KEY_UP, KEY_Down, KEY_DOWN, KEY_Right, KEY_RIGHT, diff --git a/radio/src/targets/horus/keys_driver.cpp b/radio/src/targets/horus/keys_driver.cpp index 009fb427b..4bb75a3f3 100644 --- a/radio/src/targets/horus/keys_driver.cpp +++ b/radio/src/targets/horus/keys_driver.cpp @@ -25,19 +25,19 @@ uint32_t readKeys() uint32_t result = 0; if (~KEYS_GPIO_REG_MENU & KEYS_GPIO_PIN_MENU) - result |= 1 << KEY_MENU; + result |= 1 << KEY_PGUP; if (~KEYS_GPIO_REG_EXIT & KEYS_GPIO_PIN_EXIT) - result |= 1 << KEY_EXIT; + result |= 1 << KEY_PGDN; if (~KEYS_GPIO_REG_ENTER & KEYS_GPIO_PIN_ENTER) result |= 1 << KEY_ENTER; if (~KEYS_GPIO_REG_UP & KEYS_GPIO_PIN_UP) - result |= 1 << KEY_UP; + result |= 1 << KEY_MODEL; if (~KEYS_GPIO_REG_DOWN & KEYS_GPIO_PIN_DOWN) - result |= 1 << KEY_DOWN; + result |= 1 << KEY_EXIT; if (~KEYS_GPIO_REG_RIGHT & KEYS_GPIO_PIN_RIGHT) - result |= 1 << KEY_RIGHT; + result |= 1 << KEY_TELEM; if (~KEYS_GPIO_REG_LEFT & KEYS_GPIO_PIN_LEFT) - result |= 1 << KEY_LEFT; + result |= 1 << KEY_RADIO; // TRACE("readKeys(): %x", result); diff --git a/radio/src/targets/simu/simpgmspace.cpp b/radio/src/targets/simu/simpgmspace.cpp index e3d78477c..4bb3c425a 100644 --- a/radio/src/targets/simu/simpgmspace.cpp +++ b/radio/src/targets/simu/simpgmspace.cpp @@ -165,14 +165,18 @@ void simuSetKey(uint8_t key, bool state) { // TRACE("simuSetKey(%d, %d)", key, state); switch (key) { +#if !defined(PCBHORUS) KEY_CASE(KEY_MENU, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU) KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT) +#endif #if defined(PCBHORUS) + KEY_CASE(KEY_PGUP, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU) + KEY_CASE(KEY_PGDN, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT) KEY_CASE(KEY_ENTER, KEYS_GPIO_REG_ENTER, KEYS_GPIO_PIN_ENTER) - KEY_CASE(KEY_RIGHT, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT) - KEY_CASE(KEY_LEFT, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT) - KEY_CASE(KEY_UP, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP) - KEY_CASE(KEY_DOWN, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN) + KEY_CASE(KEY_TELEM, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT) + KEY_CASE(KEY_RADIO, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT) + KEY_CASE(KEY_MODEL, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP) + KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN) #elif defined(PCBTARANIS) || defined(PCBFLAMENCO) KEY_CASE(KEY_ENTER, KEYS_GPIO_REG_ENTER, KEYS_GPIO_PIN_ENTER) KEY_CASE(KEY_PAGE, KEYS_GPIO_REG_PAGE, KEYS_GPIO_PIN_PAGE)