From e807ccbebffcf8d8665b5156ee137dccc5cbe3ba Mon Sep 17 00:00:00 2001 From: philmoz Date: Mon, 27 May 2024 18:33:53 +1000 Subject: [PATCH] refactor: key handling (#4849) --- companion/src/simulation/simulateduiwidget.h | 28 +++++++++++ .../src/simulation/simulateduiwidget9X.cpp | 14 +++--- .../src/simulation/simulateduiwidgetBoxer.cpp | 14 +++--- .../simulation/simulateduiwidgetCommando8.cpp | 16 +++---- .../src/simulation/simulateduiwidgetEL18.cpp | 14 +++--- .../simulation/simulateduiwidgetJumperT12.cpp | 12 ++--- .../simulation/simulateduiwidgetJumperT14.cpp | 8 ++-- .../simulation/simulateduiwidgetJumperT16.cpp | 12 ++--- .../simulation/simulateduiwidgetJumperT18.cpp | 12 ++--- .../simulation/simulateduiwidgetJumperT20.cpp | 8 ++-- .../simulateduiwidgetJumperTLITE.cpp | 12 ++--- .../simulateduiwidgetJumperTPRO.cpp | 8 ++-- .../simulation/simulateduiwidgetLR3PRO.cpp | 12 ++--- .../src/simulation/simulateduiwidgetNV14.cpp | 14 +++--- .../src/simulation/simulateduiwidgetPL18.cpp | 14 +++--- .../simulation/simulateduiwidgetPocket.cpp | 14 +++--- .../src/simulation/simulateduiwidgetT8.cpp | 16 +++---- .../src/simulation/simulateduiwidgetTX12.cpp | 14 +++--- .../src/simulation/simulateduiwidgetTX16S.cpp | 14 +++--- .../src/simulation/simulateduiwidgetX10.cpp | 12 ++--- .../src/simulation/simulateduiwidgetX12.cpp | 14 +++--- .../src/simulation/simulateduiwidgetX7.cpp | 8 ++-- .../src/simulation/simulateduiwidgetX9.cpp | 12 ++--- .../simulation/simulateduiwidgetX9D2019.cpp | 8 ++-- .../src/simulation/simulateduiwidgetX9E.cpp | 8 ++-- .../simulation/simulateduiwidgetX9LITE.cpp | 8 ++-- .../src/simulation/simulateduiwidgetXLITE.cpp | 14 +++--- .../src/simulation/simulateduiwidgetZorro.cpp | 14 +++--- radio/src/gui/128x64/model_curve_edit.cpp | 24 ++++------ radio/src/gui/128x64/model_custom_scripts.cpp | 2 +- radio/src/gui/128x64/model_failsafe.cpp | 1 - radio/src/gui/128x64/model_flightmodes.cpp | 4 +- radio/src/gui/128x64/model_input_edit.cpp | 14 ++---- .../src/gui/128x64/model_logical_switches.cpp | 3 +- radio/src/gui/128x64/model_mix_edit.cpp | 14 ++---- radio/src/gui/128x64/model_outputs.cpp | 4 +- radio/src/gui/128x64/model_select.cpp | 39 ++++++---------- radio/src/gui/128x64/model_setup.cpp | 23 ++-------- .../gui/128x64/model_special_functions.cpp | 3 -- radio/src/gui/128x64/model_telemetry.cpp | 2 - radio/src/gui/128x64/radio_diaganas.cpp | 2 - radio/src/gui/128x64/radio_setup.cpp | 4 +- radio/src/gui/128x64/view_about.cpp | 4 +- radio/src/gui/128x64/view_channels.cpp | 4 +- radio/src/gui/128x64/view_main.cpp | 31 +++++-------- radio/src/gui/128x64/view_statistics.cpp | 46 ++----------------- radio/src/gui/212x64/model_curve_edit.cpp | 2 - radio/src/gui/212x64/model_custom_scripts.cpp | 2 +- radio/src/gui/212x64/model_failsafe.cpp | 1 - radio/src/gui/212x64/model_flightmodes.cpp | 6 +-- radio/src/gui/212x64/model_gvars.cpp | 1 - radio/src/gui/212x64/model_input_edit.cpp | 1 - .../src/gui/212x64/model_logical_switches.cpp | 2 - radio/src/gui/212x64/model_mix_edit.cpp | 1 - radio/src/gui/212x64/model_outputs.cpp | 2 - radio/src/gui/212x64/model_select.cpp | 9 ++-- radio/src/gui/212x64/model_setup.cpp | 10 +--- .../gui/212x64/model_special_functions.cpp | 2 - radio/src/gui/212x64/model_telemetry.cpp | 2 - radio/src/gui/212x64/radio_diaganas.cpp | 2 +- radio/src/gui/212x64/radio_setup.cpp | 2 +- radio/src/gui/212x64/view_about.cpp | 4 +- radio/src/gui/212x64/view_channels.cpp | 2 +- radio/src/gui/212x64/view_main.cpp | 9 ++-- radio/src/gui/212x64/view_statistics.cpp | 46 ++++++++----------- radio/src/gui/colorlcd/LvglWrapper.cpp | 1 - radio/src/gui/colorlcd/gvar_numberedit.cpp | 2 - radio/src/gui/colorlcd/menu_model.cpp | 2 +- radio/src/gui/colorlcd/model_templates.cpp | 1 - .../src/gui/colorlcd/select_fab_carousel.cpp | 1 - .../src/gui/common/stdlcd/draw_functions.cpp | 2 - radio/src/gui/common/stdlcd/menus.cpp | 2 +- radio/src/gui/common/stdlcd/model_inputs.cpp | 3 -- radio/src/gui/common/stdlcd/model_mixes.cpp | 3 -- .../common/stdlcd/model_module_options.cpp | 3 +- .../common/stdlcd/model_receiver_options.cpp | 3 +- .../gui/common/stdlcd/model_usbjoystick.cpp | 17 ++----- .../gui/common/stdlcd/radio_ghost_menu.cpp | 2 +- .../src/gui/common/stdlcd/radio_hardware.cpp | 2 +- .../gui/common/stdlcd/radio_power_meter.cpp | 3 +- .../src/gui/common/stdlcd/radio_sdmanager.cpp | 4 -- .../common/stdlcd/radio_spectrum_analyser.cpp | 3 +- .../src/gui/common/stdlcd/view_telemetry.cpp | 11 ++--- radio/src/gui/navigation/navigation_9x.cpp | 2 +- radio/src/gui/navigation/navigation_x7.cpp | 15 +----- radio/src/gui/navigation/navigation_x9d.cpp | 8 +--- radio/src/gui/navigation/navigation_xlite.cpp | 2 - radio/src/hal/key_driver.h | 1 - radio/src/keys.cpp | 36 +++++++++++---- radio/src/lua/api_general.cpp | 4 +- radio/src/lua/interface.cpp | 3 -- radio/src/lua/lua_widget.cpp | 8 ---- radio/src/main.cpp | 7 --- radio/src/simu.cpp | 4 +- radio/src/targets/taranis/hal.h | 28 +++++------ radio/src/thirdparty/libopenui/src/menu.cpp | 7 +-- .../thirdparty/libopenui/src/menutoolbar.cpp | 5 -- radio/src/thirdparty/libopenui/src/window.cpp | 22 --------- radio/util/hw_defs/generator.py | 1 - radio/util/hw_defs/hal_keys.py | 1 - radio/util/hw_defs/lua_keys.jinja | 39 ++++++++-------- 101 files changed, 372 insertions(+), 570 deletions(-) diff --git a/companion/src/simulation/simulateduiwidget.h b/companion/src/simulation/simulateduiwidget.h index acb2b96dccd..7a31258cde1 100644 --- a/companion/src/simulation/simulateduiwidget.h +++ b/companion/src/simulation/simulateduiwidget.h @@ -35,6 +35,34 @@ class LcdWidget; class RadioKeyWidget; class RadioUiAction; +// Match with /radio/src/hal/key_driver.h +enum EnumKeys { + KEY_MENU, + KEY_EXIT, + KEY_ENTER, + + KEY_PAGEUP, + KEY_PAGEDN, + + KEY_UP, + KEY_DOWN, + + KEY_LEFT, + KEY_RIGHT, + + KEY_PLUS, + KEY_MINUS, + + KEY_MODEL, + KEY_TELE, + KEY_SYS, + + KEY_SHIFT, + KEY_BIND, + + MAX_KEYS +}; + /* * This is a base class for the main hardware-specific radio user interface, including LCD screen and navigation buttons/widgets. * It is responsible for hanlding all interactions with this part of the simulation (vs. common radio widgets like sticks/switches/knobs). diff --git a/companion/src/simulation/simulateduiwidget9X.cpp b/companion/src/simulation/simulateduiwidget9X.cpp index e461c113415..4edd27d81f6 100644 --- a/companion/src/simulation/simulateduiwidget9X.cpp +++ b/companion/src/simulation/simulateduiwidget9X.cpp @@ -40,25 +40,25 @@ SimulatedUIWidget9X::SimulatedUIWidget9X(SimulatorInterface * simulator, QWidget int x = 68, y = 91, oR = 63; polygon << QPoint(x, y) << polyArc(x, y, oR, -45, 45); - act = new RadioUiAction(10, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP % (hasRotEnc ? QString("") : "|" % SIMU_STR_HLP_MOUSE_UP), SIMU_STR_HLP_ACT_UP); + act = new RadioUiAction(KEY_PLUS, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP % (hasRotEnc ? QString("") : "|" % SIMU_STR_HLP_MOUSE_UP), SIMU_STR_HLP_ACT_UP); addRadioWidget(ui->leftbuttons->addArea(polygon, "9X/9xcursup.png", act)); polygon.clear(); polygon << QPoint(x, y) << polyArc(x, y, oR, 135, 225); - act = new RadioUiAction(11, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN % (hasRotEnc ? QString("") : "|" % SIMU_STR_HLP_MOUSE_DN), SIMU_STR_HLP_ACT_DN); + act = new RadioUiAction(KEY_MINUS, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN % (hasRotEnc ? QString("") : "|" % SIMU_STR_HLP_MOUSE_DN), SIMU_STR_HLP_ACT_DN); addRadioWidget(ui->leftbuttons->addArea(polygon, "9X/9xcursdown.png", act)); polygon.clear(); polygon << QPoint(x, y) << polyArc(x, y, oR, 45, 135); - act = new RadioUiAction(11, QList() << Qt::Key_Right << Qt::Key_Minus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); + act = new RadioUiAction(KEY_MINUS, QList() << Qt::Key_Right << Qt::Key_Minus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); addRadioWidget(ui->leftbuttons->addArea(polygon, "9X/9xcursmin.png", act)); polygon.clear(); polygon << QPoint(x, y) << polyArc(x, y, oR, 225, 315); - act = new RadioUiAction(10, QList() << Qt::Key_Left << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); + act = new RadioUiAction(KEY_PLUS, QList() << Qt::Key_Left << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); addRadioWidget(ui->leftbuttons->addArea(polygon, "9X/9xcursplus.png", act)); - act = new RadioUiAction(0, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEY_ENTER, SIMU_STR_HLP_ACT_MENU); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEY_ENTER, SIMU_STR_HLP_ACT_MENU); addRadioWidget(ui->rightbuttons->addArea(QRect(16, 54, 60, 34), "9X/9xmenumenu.png", act)); if (!hasRotEnc) { @@ -66,14 +66,14 @@ SimulatedUIWidget9X::SimulatedUIWidget9X(SimulatorInterface * simulator, QWidget m_mouseMidClickAction->setText(act->getText() % "|" % SIMU_STR_HLP_MOUSE_MID); } - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->rightbuttons->addArea(QRect(16, 114, 60, 34), "9X/9xmenuexit.png", act)); addRadioWidget(ui->leftbuttons->addArea(QRect(6, 149, 30, 30), "9X/9xcursphoto.png", m_screenshotAction)); if (hasRotEnc) { addRadioAction(new RadioUiAction(-1, 0, SIMU_STR_HLP_MOUSE_SCRL, SIMU_STR_HLP_ROTENC % "|" % SIMU_STR_HLP_ROTENC_LR)); - m_mouseMidClickAction = new RadioUiAction(14, Qt::Key_Insert, SIMU_STR_HLP_KEY_INS % "|" % SIMU_STR_HLP_MOUSE_MID, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_SYS, Qt::Key_Insert, SIMU_STR_HLP_KEY_INS % "|" % SIMU_STR_HLP_MOUSE_MID, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->leftbuttons->addArea(QRect(0, 0, 0, 0), "9X/9xcurs.png", m_mouseMidClickAction)); } diff --git a/companion/src/simulation/simulateduiwidgetBoxer.cpp b/companion/src/simulation/simulateduiwidgetBoxer.cpp index 4d7debed74f..877d22e8a4e 100644 --- a/companion/src/simulation/simulateduiwidgetBoxer.cpp +++ b/companion/src/simulation/simulateduiwidgetBoxer.cpp @@ -13,25 +13,25 @@ SimulatedUIWidgetBoxer::SimulatedUIWidgetBoxer(SimulatorInterface *simulator, QW // add actions in order of appearance on the help menu - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(QRect(80, 10, 60, 30), "Boxer/right-mdl.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(40, 60, 46, 90), "Boxer/right-ent.png", m_mouseMidClickAction)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(18, 10, 66, 30), "Boxer/left-sys.png", act)); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(QRect(72, 149, 62, 24), "Boxer/left-tele.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(72, 79, 62, 24), "Boxer/left-pagedn.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(QRect(72, 114, 62, 24), "Boxer/left-pageup.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(72, 44, 62, 24), "Boxer/left-rtn.png", act)); m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus << Qt::Key_Equal << Qt::Key_Left, SIMU_STR_HLP_KEYS_GO_LFT, SIMU_STR_HLP_ACT_ROT_LFT); diff --git a/companion/src/simulation/simulateduiwidgetCommando8.cpp b/companion/src/simulation/simulateduiwidgetCommando8.cpp index 572eb9e3505..f04fed2ed61 100644 --- a/companion/src/simulation/simulateduiwidgetCommando8.cpp +++ b/companion/src/simulation/simulateduiwidgetCommando8.cpp @@ -13,28 +13,28 @@ SimulatedUIWidgetCommando8::SimulatedUIWidgetCommando8(SimulatorInterface *simul // add actions in order of appearance on the help menu - act = new RadioUiAction(11, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MINUS, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->bottom->addArea(QRect(50, 44, 18, 18), "Commando8/left-mdl.png", act)); - act = new RadioUiAction(10, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); + act = new RadioUiAction(KEY_PLUS, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); addRadioWidget(ui->bottom->addArea(QRect(248, 25, 18, 18), "Commando8/right-up.png", act)); - act = new RadioUiAction(11, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); + act = new RadioUiAction(KEY_MINUS, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); addRadioWidget(ui->bottom->addArea(QRect(248, 62, 18, 18), "Commando8/right-dn.png", act)); - act = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); + act = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); addRadioWidget(ui->bottom->addArea(QRect(250, 45, 15, 15), "Commando8/right-ent.png", act)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->bottom->addArea(QRect(34, 46, 15, 15), "Commando8/left-sys.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->bottom->addArea(QRect(14, 44, 18, 18), "Commando8/left-rtn.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->bottom->addArea(QRect(267, 43, 18, 18), "Commando8/right-pagedn.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->bottom->addArea(QRect(230, 43, 18, 18), "Commando8/right-pageup.png", act)); diff --git a/companion/src/simulation/simulateduiwidgetEL18.cpp b/companion/src/simulation/simulateduiwidgetEL18.cpp index 9285f1f6ccc..d7cbc838a1d 100644 --- a/companion/src/simulation/simulateduiwidgetEL18.cpp +++ b/companion/src/simulation/simulateduiwidgetEL18.cpp @@ -37,25 +37,25 @@ SimulatedUIWidgetEL18::SimulatedUIWidgetEL18(SimulatorInterface *simulator, QWid // allow for colorlcd key events and see what works // the mouse click areas do not map to visual buttons on the background images - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(QRect(10, 1, 80, 35), "NV14/left.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(10, 40, 80, 35), "NV14/left.png", m_mouseMidClickAction)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 80, 80, 35), "NV14/left.png", act)); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 120, 80, 35), "NV14/left.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 160, 80, 35), "NV14/left.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 200, 80, 35), "NV14/left.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEY_DN % "
" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 240, 80, 35), "NV14/left.png", act)); diff --git a/companion/src/simulation/simulateduiwidgetJumperT12.cpp b/companion/src/simulation/simulateduiwidgetJumperT12.cpp index d34fb2f693c..129d8be48d2 100644 --- a/companion/src/simulation/simulateduiwidgetJumperT12.cpp +++ b/companion/src/simulation/simulateduiwidgetJumperT12.cpp @@ -11,22 +11,22 @@ SimulatedUIWidgetJumperT12::SimulatedUIWidgetJumperT12(SimulatorInterface *simul ui->setupUi(this); - act = new RadioUiAction(6, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); + act = new RadioUiAction(KEY_UP, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); addRadioWidget(ui->rightbuttons->addArea(QRect(69, 11, 60, 25), "JumperT12/right_up.png", act)); - act = new RadioUiAction(7, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); + act = new RadioUiAction(KEY_DOWN, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(61, 115, 60, 25), "JumperT12/right_down.png", act)); - act = new RadioUiAction(9, QList() << Qt::Key_Right << Qt::Key_Plus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); + act = new RadioUiAction(KEY_RIGHT, QList() << Qt::Key_Right << Qt::Key_Plus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); addRadioWidget(ui->rightbuttons->addArea(QRect(109, 53, 30, 40), "JumperT12/right_right.png", act)); - act = new RadioUiAction(8, QList() << Qt::Key_Left << Qt::Key_Minus, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); + act = new RadioUiAction(KEY_LEFT, QList() << Qt::Key_Left << Qt::Key_Minus, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); addRadioWidget(ui->rightbuttons->addArea(QRect(49, 62, 30, 40), "JumperT12/right_left.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); addRadioWidget(ui->leftbuttons->addArea(QRect(21, 30, 60, 25), "JumperT12/left_ent.png", m_mouseMidClickAction)); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(21, 80, 60, 60), "JumperT12/left_exit.png", act)); addRadioWidget(ui->leftbuttons->addArea(QRect(9, 154, 30, 30), "JumperT12/left_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetJumperT14.cpp b/companion/src/simulation/simulateduiwidgetJumperT14.cpp index f965f4efc6b..fad5f407919 100644 --- a/companion/src/simulation/simulateduiwidgetJumperT14.cpp +++ b/companion/src/simulation/simulateduiwidgetJumperT14.cpp @@ -11,16 +11,16 @@ SimulatedUIWidgetJumperT14::SimulatedUIWidgetJumperT14(SimulatorInterface *simul ui->setupUi(this); - act = new RadioUiAction(0, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); addRadioWidget(ui->leftbuttons->addArea(QRect(130, 50, 50, 30), "JumperT14/left.png", act)); - act = new RadioUiAction(3, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); addRadioWidget(ui->leftbuttons->addArea(QRect(130, 110, 50, 30), "JumperT14/left.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(130, 170, 50, 30), "JumperT14/left.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(100, 80, 70, 100), "JumperT14/right.png", m_mouseMidClickAction)); //addRadioWidget(ui->leftbuttons->addArea(QRect(10, 65, 70, 50), "JumperT14/left_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetJumperT16.cpp b/companion/src/simulation/simulateduiwidgetJumperT16.cpp index 2d787763003..03304cdb1dd 100644 --- a/companion/src/simulation/simulateduiwidgetJumperT16.cpp +++ b/companion/src/simulation/simulateduiwidgetJumperT16.cpp @@ -33,27 +33,27 @@ SimulatedUIWidgetJumperT16::SimulatedUIWidgetJumperT16(SimulatorInterface *simul // add actions in order of appearance on the help menu - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->leftbuttons->addArea(QRect(50, 70, 80, 35), "JumperT16/left_mdl.png", act)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(25, 10, 95, 35), "JumperT16/left_sys.png", act)); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(QRect(50, 190, 80, 35), "JumperT16/left_tele.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEY_DN % "
" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN); addRadioWidget(ui->rightbuttons->addArea(QRect(50, 10, 95, 35), "JumperT16/right_rtn.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(50, 131, 80, 35), "JumperT16/left_page.png", act)); m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus, SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_ROT_LFT); m_scrollDnAction = new RadioUiAction(-1, QList() << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_PLS % "|" % SIMU_STR_HLP_MOUSE_DN, SIMU_STR_HLP_ACT_ROT_RGT); connectScrollActions(); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(55, 90, 56, 120), "JumperT16/right_ent.png", m_mouseMidClickAction)); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 252, 30, 30), "JumperT16/left_scrnsht.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetJumperT18.cpp b/companion/src/simulation/simulateduiwidgetJumperT18.cpp index af4ae50654e..09cf6c81788 100644 --- a/companion/src/simulation/simulateduiwidgetJumperT18.cpp +++ b/companion/src/simulation/simulateduiwidgetJumperT18.cpp @@ -33,27 +33,27 @@ SimulatedUIWidgetJumperT18::SimulatedUIWidgetJumperT18(SimulatorInterface *simul // add actions in order of appearance on the help menu - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->leftbuttons->addArea(QRect(60, 90, 80, 35), "JumperT18/left_mdl.png", act)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(25, 5, 100, 40), "JumperT18/left_sys.png", act)); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(QRect(60, 180, 80, 35), "JumperT18/left_tele.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEY_DN % "
" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN); addRadioWidget(ui->rightbuttons->addArea(QRect(20, 5, 100, 40), "JumperT18/right_rtn.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(60, 140, 80, 35), "JumperT18/left.png", act)); m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus, SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_ROT_LFT); m_scrollDnAction = new RadioUiAction(-1, QList() << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_PLS % "|" % SIMU_STR_HLP_MOUSE_DN, SIMU_STR_HLP_ACT_ROT_RGT); connectScrollActions(); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(25, 90, 70, 130), "JumperT18/right_ent.png", m_mouseMidClickAction)); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 245, 30, 30), "JumperT18/left_scrnsht.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetJumperT20.cpp b/companion/src/simulation/simulateduiwidgetJumperT20.cpp index 807b3548743..9fac3bd8378 100644 --- a/companion/src/simulation/simulateduiwidgetJumperT20.cpp +++ b/companion/src/simulation/simulateduiwidgetJumperT20.cpp @@ -11,16 +11,16 @@ SimulatedUIWidgetJumperT20::SimulatedUIWidgetJumperT20(SimulatorInterface *simul ui->setupUi(this); - act = new RadioUiAction(0, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); addRadioWidget(ui->leftbuttons->addArea(QRect(0, 30, 51, 28), "JumperT20/left.png", act)); - act = new RadioUiAction(3, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); addRadioWidget(ui->leftbuttons->addArea(QRect(0, 70, 51, 28), "JumperT20/left.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 110, 51, 28), "JumperT20/left.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(130, 50, 50, 70), "JumperT20/right.png", m_mouseMidClickAction)); m_backlightColors << QColor(215, 243, 255); // X7 Blue diff --git a/companion/src/simulation/simulateduiwidgetJumperTLITE.cpp b/companion/src/simulation/simulateduiwidgetJumperTLITE.cpp index 20d6db70d7d..84d4b2240df 100644 --- a/companion/src/simulation/simulateduiwidgetJumperTLITE.cpp +++ b/companion/src/simulation/simulateduiwidgetJumperTLITE.cpp @@ -11,22 +11,22 @@ SimulatedUIWidgetJumperTLITE::SimulatedUIWidgetJumperTLITE(SimulatorInterface *s ui->setupUi(this); - act = new RadioUiAction(6, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); + act = new RadioUiAction(KEY_UP, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); addRadioWidget(ui->rightbuttons->addArea(QRect(40, 15, 70, 50), "JumperTLITE/right_top.png", act)); - act = new RadioUiAction(7, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); + act = new RadioUiAction(KEY_DOWN, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(47, 65, 70, 50), "JumperTLITE/right_bottom.png", act)); - act = new RadioUiAction(9, QList() << Qt::Key_Right << Qt::Key_Plus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); + act = new RadioUiAction(KEY_RIGHT, QList() << Qt::Key_Right << Qt::Key_Plus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); addRadioWidget(ui->bottombuttons->addArea(QRect(150, 73, 80, 30), "JumperTLITE/bottom_right.png", act)); - act = new RadioUiAction(8, QList() << Qt::Key_Left << Qt::Key_Minus, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); + act = new RadioUiAction(KEY_LEFT, QList() << Qt::Key_Left << Qt::Key_Minus, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); addRadioWidget(ui->bottombuttons->addArea(QRect(24, 73, 80, 30), "JumperTLITE/bottom_left.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); addRadioWidget(ui->leftbuttons->addArea(QRect(5, 15, 70, 50), "JumperTLITE/left_top.png", m_mouseMidClickAction)); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 65, 70, 50), "JumperTLITE/left_bottom.png", act)); //addRadioWidget(ui->leftbuttons->addArea(QRect(10, 65, 70, 50), "JumperTLITE/left_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetJumperTPRO.cpp b/companion/src/simulation/simulateduiwidgetJumperTPRO.cpp index d61a155092f..2ccbb920026 100644 --- a/companion/src/simulation/simulateduiwidgetJumperTPRO.cpp +++ b/companion/src/simulation/simulateduiwidgetJumperTPRO.cpp @@ -12,16 +12,16 @@ SimulatedUIWidgetJumperTPRO::SimulatedUIWidgetJumperTPRO(SimulatorInterface *sim ui->setupUi(this); - act = new RadioUiAction(0, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); addRadioWidget(ui->leftbuttons->addArea(QRect(70, 85, 110, 90), "JumperTPRO/left.png", act)); - act = new RadioUiAction(3, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); addRadioWidget(ui->leftbuttons->addArea(QRect(53, 174, 110, 90), "JumperTPRO/left.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(11, 257, 110, 90), "JumperTPRO/left.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(10, 96, 200, 220), "JumperTPRO/right.png", m_mouseMidClickAction)); //addRadioWidget(ui->leftbuttons->addArea(QRect(10, 65, 70, 50), "JumperTPRO/left_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetLR3PRO.cpp b/companion/src/simulation/simulateduiwidgetLR3PRO.cpp index 9b6f162621f..dfee765c76f 100644 --- a/companion/src/simulation/simulateduiwidgetLR3PRO.cpp +++ b/companion/src/simulation/simulateduiwidgetLR3PRO.cpp @@ -11,22 +11,22 @@ SimulatedUIWidgetLR3PRO::SimulatedUIWidgetLR3PRO(SimulatorInterface *simulator, ui->setupUi(this); - act = new RadioUiAction(6, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); + act = new RadioUiAction(KEY_UP, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); addRadioWidget(ui->rightbuttons->addArea(QRect(30, 56, 30, 20), "LR3PRO/right_up.png", act)); - act = new RadioUiAction(7, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); + act = new RadioUiAction(KEY_DOWN, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(30, 120, 30, 20), "LR3PRO/right_down.png", act)); - act = new RadioUiAction(9, QList() << Qt::Key_Right << Qt::Key_Plus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); + act = new RadioUiAction(KEY_RIGHT, QList() << Qt::Key_Right << Qt::Key_Plus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); addRadioWidget(ui->rightbuttons->addArea(QRect(70, 84, 20, 30), "LR3PRO/right_plus.png", act)); - act = new RadioUiAction(8, QList() << Qt::Key_Left << Qt::Key_Minus, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); + act = new RadioUiAction(KEY_LEFT, QList() << Qt::Key_Left << Qt::Key_Minus, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); addRadioWidget(ui->rightbuttons->addArea(QRect(5, 84, 20, 30), "LR3PRO/right_minus.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); addRadioWidget(ui->rightbuttons->addArea(QRect(30, 83, 30, 30), "LR3PRO/right_enter.png", m_mouseMidClickAction)); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(58, 98, 30, 30), "LR3PRO/left_escape.png", act)); //addRadioWidget(ui->leftbuttons->addArea(QRect(10, 65, 70, 50), "LR3PRO/left_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetNV14.cpp b/companion/src/simulation/simulateduiwidgetNV14.cpp index 825ed0d098e..e6f55f20af8 100644 --- a/companion/src/simulation/simulateduiwidgetNV14.cpp +++ b/companion/src/simulation/simulateduiwidgetNV14.cpp @@ -37,25 +37,25 @@ SimulatedUIWidgetNV14::SimulatedUIWidgetNV14(SimulatorInterface *simulator, QWid // allow for colorlcd key events and see what works // the mouse click areas do not map to visual buttons on the background images - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(QRect(10, 1, 80, 35), "NV14/left.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(10, 40, 80, 35), "NV14/left.png", m_mouseMidClickAction)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 80, 80, 35), "NV14/left.png", act)); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 120, 80, 35), "NV14/left.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 160, 80, 35), "NV14/left.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 200, 80, 35), "NV14/left.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEY_DN % "
" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 240, 80, 35), "NV14/left.png", act)); diff --git a/companion/src/simulation/simulateduiwidgetPL18.cpp b/companion/src/simulation/simulateduiwidgetPL18.cpp index 5e3554245cc..4f3f9868cb4 100644 --- a/companion/src/simulation/simulateduiwidgetPL18.cpp +++ b/companion/src/simulation/simulateduiwidgetPL18.cpp @@ -37,25 +37,25 @@ SimulatedUIWidgetPL18::SimulatedUIWidgetPL18(SimulatorInterface *simulator, QWid // allow for colorlcd key events and see what works // the mouse click areas do not map to visual buttons on the background images - act = new RadioUiAction(3, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(QRect(10, 1, 80, 35), "PL18/left.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(10, 40, 80, 35), "PL18/left.png", m_mouseMidClickAction)); - act = new RadioUiAction(6, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_UP, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 80, 80, 35), "PL18/left.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 120, 80, 35), "PL18/left.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 160, 80, 35), "PL18/left.png", act)); - act = new RadioUiAction(0, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 200, 80, 35), "PL18/left.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEY_DN % "
" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 240, 80, 35), "PL18/left.png", act)); diff --git a/companion/src/simulation/simulateduiwidgetPocket.cpp b/companion/src/simulation/simulateduiwidgetPocket.cpp index 303de13549b..01735dc9995 100644 --- a/companion/src/simulation/simulateduiwidgetPocket.cpp +++ b/companion/src/simulation/simulateduiwidgetPocket.cpp @@ -13,25 +13,25 @@ SimulatedUIWidgetPocket::SimulatedUIWidgetPocket(SimulatorInterface *simulator, // add actions in order of appearance on the help menu - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(QRect(30, 95, 60, 60), "Pocket/right.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(130, 60, 60, 130), "Pocket/right.png", m_mouseMidClickAction)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(150, 95, 60, 60), "Pocket/left.png", act)); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(QRect(40, 179, 60, 30), "Pocket/left.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(40, 90, 60, 30), "Pocket/left.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(QRect(40, 130, 60, 30), "Pocket/left.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(40, 40, 60, 30), "Pocket/left.png", act)); m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus << Qt::Key_Equal << Qt::Key_Left, SIMU_STR_HLP_KEYS_GO_LFT, SIMU_STR_HLP_ACT_ROT_LFT); diff --git a/companion/src/simulation/simulateduiwidgetT8.cpp b/companion/src/simulation/simulateduiwidgetT8.cpp index c5b923377b0..ae97a2da835 100644 --- a/companion/src/simulation/simulateduiwidgetT8.cpp +++ b/companion/src/simulation/simulateduiwidgetT8.cpp @@ -13,28 +13,28 @@ SimulatedUIWidgetT8::SimulatedUIWidgetT8(SimulatorInterface *simulator, QWidget // add actions in order of appearance on the help menu - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(QRect(25, 40, 35, 20), "T8/right-mdl.png", act)); - act = new RadioUiAction(10, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); + act = new RadioUiAction(KEY_PLUS, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); addRadioWidget(ui->rightbuttons->addArea(QRect(25, 90, 35, 20), "T8/right-up.png", act)); - act = new RadioUiAction(11, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); + act = new RadioUiAction(KEY_MINUS, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(25, 135, 35, 20), "T8/right-dn.png", act)); - act = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); + act = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); addRadioWidget(ui->rightbuttons->addArea(QRect(25, 180, 35, 20), "T8/right-ent.png", act)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(60, 45, 35, 20), "T8/left-sys.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(60, 85, 35, 20), "T8/left-rtn.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(60, 135, 35, 20), "T8/left-pagedn.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(QRect(60, 180, 35, 20), "T8/left-pageup.png", act)); diff --git a/companion/src/simulation/simulateduiwidgetTX12.cpp b/companion/src/simulation/simulateduiwidgetTX12.cpp index 5c3c00a44b4..17d7e7512ad 100644 --- a/companion/src/simulation/simulateduiwidgetTX12.cpp +++ b/companion/src/simulation/simulateduiwidgetTX12.cpp @@ -13,25 +13,25 @@ SimulatedUIWidgetTX12::SimulatedUIWidgetTX12(SimulatorInterface *simulator, QWid // add actions in order of appearance on the help menu - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(QRect(60, 5, 90, 60), "TX12/right-mdl.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(45, 100, 70, 120), "TX12/right-ent.png", m_mouseMidClickAction)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(35, 5, 80, 50), "TX12/left-sys.png", act)); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(QRect(90, 210, 80, 35), "TX12/left-tele.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(75, 125, 80, 35), "TX12/left-pagedn.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(QRect(80, 170, 80, 35), "TX12/left-pageup.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(70, 85, 80, 35), "TX12/left-rtn.png", act)); m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus, SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_ROT_LFT); diff --git a/companion/src/simulation/simulateduiwidgetTX16S.cpp b/companion/src/simulation/simulateduiwidgetTX16S.cpp index 6c6b32a4126..c3183cf61a2 100644 --- a/companion/src/simulation/simulateduiwidgetTX16S.cpp +++ b/companion/src/simulation/simulateduiwidgetTX16S.cpp @@ -33,25 +33,25 @@ SimulatedUIWidgetTX16S::SimulatedUIWidgetTX16S(SimulatorInterface *simulator, QW // add actions in order of appearance on the help menu - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(QRect(40, 0, 110, 35), "TX16S/right_mdl.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(45, 70, 100, 160), "TX16S/right_ent.png", m_mouseMidClickAction)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(32, 1, 80, 35), "TX16S/left_sys.png", act)); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(QRect(55, 220, 80, 35), "TX16S/left_tele.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(55, 115, 80, 35), "TX16S/left_page.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(QRect(55, 160, 80, 35), "TX16S/left_page2.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEY_DN % "
" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN); addRadioWidget(ui->leftbuttons->addArea(QRect(55, 55, 80, 35), "TX16S/left_rtn.png", act)); diff --git a/companion/src/simulation/simulateduiwidgetX10.cpp b/companion/src/simulation/simulateduiwidgetX10.cpp index cd30a469a70..3201915accb 100644 --- a/companion/src/simulation/simulateduiwidgetX10.cpp +++ b/companion/src/simulation/simulateduiwidgetX10.cpp @@ -38,33 +38,33 @@ SimulatedUIWidgetX10::SimulatedUIWidgetX10(SimulatorInterface *simulator, QWidge polygon.clear(); polygon << polyArc(x, y, oR, -45, 45) << polyArc(x, y, iR, -45, 45); - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->leftbuttons->addArea(polygon, "X10/left_mdl.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 225, 315) << polyArc(x, y, iR, 225, 315); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(polygon, "X10/left_sys.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 45, 135) << polyArc(x, y, iR, 45, 135); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->leftbuttons->addArea(polygon, "X10/left_tele.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 135, 225) << polyArc(x, y, iR, 135, 225); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEY_DN % "
" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN); addRadioWidget(ui->leftbuttons->addArea(polygon, "X10/left_rtn.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(polyArc(x, y, iR), "X10/left_page.png", act)); m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus, SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_ROT_LFT); m_scrollDnAction = new RadioUiAction(-1, QList() << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_PLS % "|" % SIMU_STR_HLP_MOUSE_DN, SIMU_STR_HLP_ACT_ROT_RGT); connectScrollActions(); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(polyArc(98, y, iR), "X10/right_ent.png", m_mouseMidClickAction)); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 252, 30, 30), "X10/left_scrnsht.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetX12.cpp b/companion/src/simulation/simulateduiwidgetX12.cpp index ad4c5d5c40b..1e0a5ee4166 100644 --- a/companion/src/simulation/simulateduiwidgetX12.cpp +++ b/companion/src/simulation/simulateduiwidgetX12.cpp @@ -37,32 +37,32 @@ SimulatedUIWidgetX12::SimulatedUIWidgetX12(SimulatorInterface *simulator, QWidge int x = 74, y = 190, oR = 63, iR = 40; polygon << polyArc(x, y, oR, 225, 315) << polyArc(x, y, iR, 225, 315); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(polygon, "X12/left_btn1.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 135, 225) << polyArc(x, y, iR, 135, 225); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(polygon, "X12/left_btn2.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, -45, 45) << polyArc(x, y, iR, -45, 45); - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(polygon, "X12/right_btnU.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 225, 315) << polyArc(x, y, iR, 225, 315); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->rightbuttons->addArea(polygon, "X12/right_btnL.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 45, 135) << polyArc(x, y, iR, 45, 135); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->rightbuttons->addArea(polygon, "X12/right_btnR.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 135, 225) << polyArc(x, y, iR, 135, 225); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEY_DN % "
" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN); addRadioWidget(ui->rightbuttons->addArea(polygon, "X12/right_btnD.png", act)); @@ -70,7 +70,7 @@ SimulatedUIWidgetX12::SimulatedUIWidgetX12(SimulatorInterface *simulator, QWidge m_scrollDnAction = new RadioUiAction(-1, QList() << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_PLS % "|" % SIMU_STR_HLP_MOUSE_DN, SIMU_STR_HLP_ACT_ROT_RGT); connectScrollActions(); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(polyArc(x, y, iR), "X12/right_ent.png", m_mouseMidClickAction)); addRadioWidget(ui->leftbuttons->addArea(QRect(9, 259, 30, 30), "X12/left_scrnsht.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetX7.cpp b/companion/src/simulation/simulateduiwidgetX7.cpp index e8247b60c2e..635275239ef 100644 --- a/companion/src/simulation/simulateduiwidgetX7.cpp +++ b/companion/src/simulation/simulateduiwidgetX7.cpp @@ -17,22 +17,22 @@ SimulatedUIWidgetX7::SimulatedUIWidgetX7(SimulatorInterface *simulator, QWidget QPoint ctr(70, 91); polygon << polyArc(ctr.x(), ctr.y(), 50, -90, 90) << polyArc(ctr.x(), ctr.y(), 22, -90, 90); - act = new RadioUiAction(0, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); addRadioWidget(ui->leftbuttons->addArea(polyArc(ctr.x(), ctr.y(), 20), "X7/left_menu.png", act)); - act = new RadioUiAction(3, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); addRadioWidget(ui->leftbuttons->addArea(polygon, "X7/left_page.png", act)); polygon.clear(); polygon << polyArc(ctr.x(), ctr.y(), 50, 90, 270) << polyArc(ctr.x(), ctr.y(), 22, 90, 270); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(polygon, "X7/left_exit.png", act)); m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus << Qt::Key_Equal << Qt::Key_Left, SIMU_STR_HLP_KEYS_GO_LFT, SIMU_STR_HLP_ACT_ROT_LFT); m_scrollDnAction = new RadioUiAction(-1, QList() << Qt::Key_Plus << Qt::Key_Right, SIMU_STR_HLP_KEYS_GO_RGT, SIMU_STR_HLP_ACT_ROT_RGT); connectScrollActions(); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(polyArc(88, 92, 33), "X7/right_ent.png", m_mouseMidClickAction)); addRadioWidget(ui->leftbuttons->addArea(QRect(9, 154, 30, 30), "X7/left_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetX9.cpp b/companion/src/simulation/simulateduiwidgetX9.cpp index bdee11d2f73..b5ccb094c79 100644 --- a/companion/src/simulation/simulateduiwidgetX9.cpp +++ b/companion/src/simulation/simulateduiwidgetX9.cpp @@ -39,20 +39,20 @@ SimulatedUIWidgetX9::SimulatedUIWidgetX9(SimulatorInterface *simulator, QWidget // left side - act = new RadioUiAction(0, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU); addRadioWidget(ui->leftbuttons->addArea(btn, "X9D/x9l1.png", act)); btn.moveTop(btn.top() + btn.height() + vsp); - act = new RadioUiAction(3, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); addRadioWidget(ui->leftbuttons->addArea(btn, "X9D/x9l2.png", act)); btn.moveTop(btn.top() + btn.height() + vsp); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(btn, "X9D/x9l3.png", act)); - m_scrollUpAction = new RadioUiAction(10, QList() << Qt::Key_Plus << Qt::Key_Equal << Qt::Key_Left, + m_scrollUpAction = new RadioUiAction(KEY_PLUS, QList() << Qt::Key_Plus << Qt::Key_Equal << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_PLS % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_PLS); - m_scrollDnAction = new RadioUiAction(11, QList() << Qt::Key_Minus << Qt::Key_Right, + m_scrollDnAction = new RadioUiAction(KEY_MINUS, QList() << Qt::Key_Minus << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_DN, SIMU_STR_HLP_ACT_MIN); // right side @@ -64,7 +64,7 @@ SimulatedUIWidgetX9::SimulatedUIWidgetX9(SimulatorInterface *simulator, QWidget addRadioWidget(ui->rightbuttons->addArea(btn, "X9D/x9r2.png", m_scrollDnAction)); btn.moveTop(btn.top() + btn.height() + vsp); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); addRadioWidget(ui->rightbuttons->addArea(btn, "X9D/x9r3.png", m_mouseMidClickAction)); addRadioWidget(ui->leftbuttons->addArea(QRect(89, 177, 30, 20), "X9D/x9l4.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetX9D2019.cpp b/companion/src/simulation/simulateduiwidgetX9D2019.cpp index c758e918566..2a991e07820 100644 --- a/companion/src/simulation/simulateduiwidgetX9D2019.cpp +++ b/companion/src/simulation/simulateduiwidgetX9D2019.cpp @@ -33,20 +33,20 @@ SimulatedUIWidgetX9D2019::SimulatedUIWidgetX9D2019(SimulatorInterface *simulator // add actions in order of appearance on the help menu - act = new RadioUiAction(0, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU); addRadioWidget(ui->leftbuttons->addArea(QRect(25, 40, 80, 35), "X9D2019/left_menu.png", act)); - act = new RadioUiAction(3, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); addRadioWidget(ui->leftbuttons->addArea(QRect(25, 85, 80, 35), "X9D2019/left_page.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(25, 140, 80, 35), "X9D2019/left_exit.png", act)); m_scrollUpAction = addRadioAction(new RadioUiAction(-1, QList() << Qt::Key_Minus << Qt::Key_Left, SIMU_STR_HLP_KEYS_GO_LFT, SIMU_STR_HLP_ACT_ROT_LFT)); m_scrollDnAction = addRadioAction(new RadioUiAction(-1, QList() << Qt::Key_Plus << Qt::Key_Equal << Qt::Key_Right, SIMU_STR_HLP_KEYS_GO_RGT, SIMU_STR_HLP_ACT_ROT_RGT)); connectScrollActions(); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(40, 30, 80, 130), "X9D2019/right_enter.png", m_mouseMidClickAction)); addRadioWidget(ui->bottom->addArea(QRect(10, 5, 30, 30), "X9D2019/bottom_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetX9E.cpp b/companion/src/simulation/simulateduiwidgetX9E.cpp index 6780fc5bdb6..5d968535c2d 100644 --- a/companion/src/simulation/simulateduiwidgetX9E.cpp +++ b/companion/src/simulation/simulateduiwidgetX9E.cpp @@ -37,24 +37,24 @@ SimulatedUIWidgetX9E::SimulatedUIWidgetX9E(SimulatorInterface *simulator, QWidge QPoint ctr(70, 100); polygon << polyArc(ctr.x(), ctr.y(), 60, -90, 0) << ctr; - act = new RadioUiAction(0, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU); addRadioWidget(ui->leftbuttons->addArea(polygon, "X9E/left_menu.png", act)); polygon.clear(); polygon << polyArc(ctr.x(), ctr.y(), 45, 0, 180); - act = new RadioUiAction(3, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); addRadioWidget(ui->leftbuttons->addArea(polygon, "X9E/left_page.png", act)); polygon.clear(); polygon << polyArc(ctr.x(), ctr.y(), 60, 180, 270) << ctr; - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(polygon, "X9E/left_exit.png", act)); m_scrollUpAction = addRadioAction(new RadioUiAction(-1, QList() << Qt::Key_Minus << Qt::Key_Left, SIMU_STR_HLP_KEYS_GO_LFT, SIMU_STR_HLP_ACT_ROT_LFT)); m_scrollDnAction = addRadioAction(new RadioUiAction(-1, QList() << Qt::Key_Plus << Qt::Key_Equal << Qt::Key_Right, SIMU_STR_HLP_KEYS_GO_RGT, SIMU_STR_HLP_ACT_ROT_RGT)); connectScrollActions(); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(polyArc(90, 100, 50), "X9E/right_enter.png", m_mouseMidClickAction)); addRadioWidget(ui->leftbuttons->addArea(QRect(10, 170, 30, 30), "X9E/left_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetX9LITE.cpp b/companion/src/simulation/simulateduiwidgetX9LITE.cpp index 1f10734d3e9..ecf4b009389 100644 --- a/companion/src/simulation/simulateduiwidgetX9LITE.cpp +++ b/companion/src/simulation/simulateduiwidgetX9LITE.cpp @@ -13,20 +13,20 @@ SimulatedUIWidgetX9LITE::SimulatedUIWidgetX9LITE(SimulatorInterface *simulator, // add actions in order of appearance on the help menu - act = new RadioUiAction(0, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); + act = new RadioUiAction(KEY_MENU, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); addRadioWidget(ui->leftbuttons->addArea(QRect(80, 20, 40, 35), "X9LITE/left_menu.png", act)); - act = new RadioUiAction(3, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); addRadioWidget(ui->leftbuttons->addArea(QRect(80, 65, 40, 35), "X9LITE/left_page.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(80, 130, 40, 35), "X9LITE/left_exit.png", act)); m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus << Qt::Key_Equal << Qt::Key_Left, SIMU_STR_HLP_KEYS_GO_LFT, SIMU_STR_HLP_ACT_ROT_LFT); m_scrollDnAction = new RadioUiAction(-1, QList() << Qt::Key_Plus << Qt::Key_Right, SIMU_STR_HLP_KEYS_GO_RGT, SIMU_STR_HLP_ACT_ROT_RGT); connectScrollActions(); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(polyArc(88, 92, 33), "X9LITE/right_ent.png", m_mouseMidClickAction)); addRadioWidget(ui->leftbuttons->addArea(QRect(30, 154, 30, 30), "X9LITE/left_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetXLITE.cpp b/companion/src/simulation/simulateduiwidgetXLITE.cpp index a28c85f7847..3ab6030950b 100644 --- a/companion/src/simulation/simulateduiwidgetXLITE.cpp +++ b/companion/src/simulation/simulateduiwidgetXLITE.cpp @@ -16,31 +16,31 @@ SimulatedUIWidgetXLITE::SimulatedUIWidgetXLITE(SimulatorInterface *simulator, QW polygon.clear(); polygon << polyArc(x, y, oR, -45, 45) << polyArc(x, y, iR, -45, 45); - act = new RadioUiAction(6, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); + act = new RadioUiAction(KEY_UP, QList() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); addRadioWidget(ui->rightbuttons->addArea(polygon, "XLITE/right_up.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 135, 225) << polyArc(x, y, iR, 135, 225); - act = new RadioUiAction(7, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); + act = new RadioUiAction(KEY_DOWN, QList() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); addRadioWidget(ui->rightbuttons->addArea(polygon, "XLITE/right_down.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 45, 135) << polyArc(x, y, iR, 45, 135); - act = new RadioUiAction(9, QList() << Qt::Key_Right << Qt::Key_Plus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); + act = new RadioUiAction(KEY_RIGHT, QList() << Qt::Key_Right << Qt::Key_Plus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS); addRadioWidget(ui->rightbuttons->addArea(polygon, "XLITE/right_right.png", act)); polygon.clear(); polygon << polyArc(x, y, oR, 225, 315) << polyArc(x, y, iR, 225, 315); - act = new RadioUiAction(8, QList() << Qt::Key_Left << Qt::Key_Minus, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); + act = new RadioUiAction(KEY_LEFT, QList() << Qt::Key_Left << Qt::Key_Minus, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN); addRadioWidget(ui->rightbuttons->addArea(polygon, "XLITE/right_left.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); addRadioWidget(ui->rightbuttons->addArea(QRect(37, 80, 25, 25), "XLITE/right_ent.png", m_mouseMidClickAction)); - act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->rightbuttons->addArea(QRect(36, 147, 27, 27), "XLITE/right_exit.png", act)); - act = new RadioUiAction(15, QList() << Qt::Key_S, SIMU_STR_HLP_KEY_SHIFT, SIMU_STR_HLP_ACT_SHIFT); + act = new RadioUiAction(KEY_SHIFT, QList() << Qt::Key_S, SIMU_STR_HLP_KEY_SHIFT, SIMU_STR_HLP_ACT_SHIFT); addRadioWidget(ui->rightbuttons->addArea(QRect(73, 129, 27, 27), "XLITE/right_shift.png", act)); addRadioWidget(ui->leftbuttons->addArea(QRect(9, 152, 25, 25), "XLITE/left_scrnshot.png", m_screenshotAction)); diff --git a/companion/src/simulation/simulateduiwidgetZorro.cpp b/companion/src/simulation/simulateduiwidgetZorro.cpp index c489c786320..af9b1942d8b 100644 --- a/companion/src/simulation/simulateduiwidgetZorro.cpp +++ b/companion/src/simulation/simulateduiwidgetZorro.cpp @@ -13,25 +13,25 @@ SimulatedUIWidgetZorro::SimulatedUIWidgetZorro(SimulatorInterface *simulator, QW // add actions in order of appearance on the help menu - act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + act = new RadioUiAction(KEY_MODEL, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); addRadioWidget(ui->rightbuttons->addArea(QRect(65, 35, 90, 45), "Zorro/right-mdl.png", act)); - m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); addRadioWidget(ui->rightbuttons->addArea(QRect(7, 84, 110, 90), "Zorro/right-ent.png", m_mouseMidClickAction)); - act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + act = new RadioUiAction(KEY_SYS, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); addRadioWidget(ui->leftbuttons->addArea(QRect(52, 39, 70, 50), "Zorro/left-sys.png", act)); - act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + act = new RadioUiAction(KEY_TELE, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); addRadioWidget(ui->rightbuttons->addArea(QRect(75, 180, 80, 35), "Zorro/right-tele.png", act)); - act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + act = new RadioUiAction(KEY_PAGEDN, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); addRadioWidget(ui->leftbuttons->addArea(QRect(70, 145, 80, 35), "Zorro/left-pagedn.png", act)); - act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + act = new RadioUiAction(KEY_PAGEUP, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); addRadioWidget(ui->leftbuttons->addArea(QRect(60, 185, 80, 35), "Zorro/left-pageup.png", act)); - act = new RadioUiAction(1, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + act = new RadioUiAction(KEY_EXIT, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); addRadioWidget(ui->leftbuttons->addArea(QRect(85, 105, 80, 35), "Zorro/left-rtn.png", act)); m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus, SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_ROT_LFT); diff --git a/radio/src/gui/128x64/model_curve_edit.cpp b/radio/src/gui/128x64/model_curve_edit.cpp index 8291fd3e5ef..69b4f49f10c 100644 --- a/radio/src/gui/128x64/model_curve_edit.cpp +++ b/radio/src/gui/128x64/model_curve_edit.cpp @@ -153,29 +153,21 @@ void menuModelCurveOne(event_t event) case EVT_KEY_LONG(KEY_ENTER): if (menuVerticalPosition > 1) { - killEvents(event); POPUP_MENU_START(onCurveOneMenu, 3, STR_CURVE_PRESET, STR_MIRROR, STR_CLEAR); } break; -#if defined(KEYS_GPIO_REG_MDL) - case EVT_KEY_FIRST(KEY_MODEL): - pushMenu(menuChannelsView); +#if defined(NAVIGATION_XLITE) + case EVT_KEY_FIRST(KEY_ENTER): + if (!keysGetState(KEY_SHIFT)) + break; killEvents(event); - break; -#elif defined(NAVIGATION_X7) - case EVT_KEY_FIRST(KEY_MENU): +#else + case EVT_KEY_BREAK(KEY_MODEL): + case EVT_KEY_BREAK(KEY_MENU): +#endif pushMenu(menuChannelsView); - killEvents(event); break; -#elif defined(NAVIGATION_XLITE) - case EVT_KEY_FIRST(KEY_ENTER): - if (keysGetState(KEY_SHIFT)) { - pushMenu(menuChannelsView); - killEvents(event); - } - break; -#endif } drawCurve(); diff --git a/radio/src/gui/128x64/model_custom_scripts.cpp b/radio/src/gui/128x64/model_custom_scripts.cpp index 7727034a62e..4e87b384753 100644 --- a/radio/src/gui/128x64/model_custom_scripts.cpp +++ b/radio/src/gui/128x64/model_custom_scripts.cpp @@ -138,7 +138,7 @@ void menuModelCustomScripts(event_t event) coord_t y; int8_t sub = menuVerticalPosition; - if (event == EVT_KEY_FIRST(KEY_ENTER)) { + if (event == EVT_KEY_BREAK(KEY_ENTER)) { s_currIdx = sub; pushMenu(menuModelCustomScriptOne); } diff --git a/radio/src/gui/128x64/model_failsafe.cpp b/radio/src/gui/128x64/model_failsafe.cpp index 23d553a0d2f..5ad85308762 100644 --- a/radio/src/gui/128x64/model_failsafe.cpp +++ b/radio/src/gui/128x64/model_failsafe.cpp @@ -65,7 +65,6 @@ void menuModelFailsafe(event_t event) wbar -= 6; if (sub == k && !READ_ONLY() && event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); POPUP_MENU_START(onFailsafeMenu, 4, STR_NONE, STR_HOLD, STR_CHANNEL2FAILSAFE, STR_CHANNELS2FAILSAFE); } diff --git a/radio/src/gui/128x64/model_flightmodes.cpp b/radio/src/gui/128x64/model_flightmodes.cpp index d9b688e62c1..a15e684e329 100644 --- a/radio/src/gui/128x64/model_flightmodes.cpp +++ b/radio/src/gui/128x64/model_flightmodes.cpp @@ -229,14 +229,14 @@ void menuModelFlightModesAll(event_t event) int8_t sub = menuVerticalPosition - HEADER_LINE; // "Check trims" button - if (sub == MAX_FLIGHT_MODES && event == EVT_KEY_FIRST(KEY_ENTER)) { + if (sub == MAX_FLIGHT_MODES && event == EVT_KEY_BREAK(KEY_ENTER)) { s_editMode = 0; trimsCheckTimer = 200; // 2 seconds } // Flight mode lines if (sub >= 0 && sub < MAX_FLIGHT_MODES && - (event == EVT_KEY_FIRST(KEY_ENTER) || event == EVT_KEY_FIRST(KEY_RIGHT))) { + (event == EVT_KEY_BREAK(KEY_ENTER) || event == EVT_KEY_FIRST(KEY_RIGHT))) { s_currIdx = sub; pushMenu(menuModelFlightModeOne); } diff --git a/radio/src/gui/128x64/model_input_edit.cpp b/radio/src/gui/128x64/model_input_edit.cpp index 5cac0c5723e..a4a14ab4976 100644 --- a/radio/src/gui/128x64/model_input_edit.cpp +++ b/radio/src/gui/128x64/model_input_edit.cpp @@ -57,20 +57,14 @@ uint8_t FM_ROW(uint8_t value) void menuModelExpoOne(event_t event) { -#if defined(KEYS_GPIO_REG_MDL) - if (event == EVT_KEY_FIRST(KEY_MODEL)) { - pushMenu(menuChannelsView); - killEvents(event); - } -#elif defined(NAVIGATION_X7) - if (event == EVT_KEY_FIRST(KEY_MENU)) { +#if defined(NAVIGATION_XLITE) + if (event == EVT_KEY_FIRST(KEY_ENTER) && keysGetState(KEY_SHIFT)) { pushMenu(menuChannelsView); killEvents(event); } -#elif defined(NAVIGATION_XLITE) - if (event == EVT_KEY_FIRST(KEY_ENTER) && keysGetState(KEY_SHIFT)) { +#else + if (event == EVT_KEY_BREAK(KEY_MODEL) || event == EVT_KEY_BREAK(KEY_MENU)) { pushMenu(menuChannelsView); - killEvents(event); } #endif ExpoData * ed = expoAddress(s_currIdx); diff --git a/radio/src/gui/128x64/model_logical_switches.cpp b/radio/src/gui/128x64/model_logical_switches.cpp index f314f81dbf0..6fb63ba6914 100644 --- a/radio/src/gui/128x64/model_logical_switches.cpp +++ b/radio/src/gui/128x64/model_logical_switches.cpp @@ -256,8 +256,7 @@ void menuModelLogicalSwitches(event_t event) uint8_t k = 0; int8_t sub = menuVerticalPosition - HEADER_LINE; - if (event == EVT_KEY_FIRST(KEY_ENTER)) { - killEvents(event); + if (event == EVT_KEY_BREAK(KEY_ENTER)) { LogicalSwitchData * cs = lswAddress(sub); if (cs->func) s_currIdx = sub; diff --git a/radio/src/gui/128x64/model_mix_edit.cpp b/radio/src/gui/128x64/model_mix_edit.cpp index eff9027f728..101b11024d8 100644 --- a/radio/src/gui/128x64/model_mix_edit.cpp +++ b/radio/src/gui/128x64/model_mix_edit.cpp @@ -90,20 +90,14 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md) void menuModelMixOne(event_t event) { -#if defined(KEYS_GPIO_REG_MDL) - if (event == EVT_KEY_FIRST(KEY_MODEL)) { - pushMenu(menuChannelsView); - killEvents(event); - } -#elif defined(NAVIGATION_X7) - if (event == EVT_KEY_FIRST(KEY_MENU)) { +#if defined(NAVIGATION_XLITE) + if (event == EVT_KEY_FIRST(KEY_ENTER) && keysGetState(KEY_SHIFT)) { pushMenu(menuChannelsView); killEvents(event); } -#elif defined(NAVIGATION_XLITE) - if (event == EVT_KEY_FIRST(KEY_ENTER) && keysGetState(KEY_SHIFT)) { +#else + if (event == EVT_KEY_BREAK(KEY_MODEL) || event == EVT_KEY_BREAK(KEY_MENU)) { pushMenu(menuChannelsView); - killEvents(event); } #endif MixData * md2 = mixAddress(s_currIdx) ; diff --git a/radio/src/gui/128x64/model_outputs.cpp b/radio/src/gui/128x64/model_outputs.cpp index e3c4a02acf9..3bcf9340e9a 100644 --- a/radio/src/gui/128x64/model_outputs.cpp +++ b/radio/src/gui/128x64/model_outputs.cpp @@ -231,8 +231,7 @@ void menuModelLimits(event_t event) uint8_t k = i+menuVerticalOffset; LcdFlags attr = (sub==MAX_OUTPUT_CHANNELS) ? INVERS : 0; - if (sub==k && event==EVT_KEY_FIRST(KEY_ENTER) && !READ_ONLY() && (k != MAX_OUTPUT_CHANNELS) ) { - killEvents(event); + if (sub==k && event==EVT_KEY_BREAK(KEY_ENTER) && !READ_ONLY() && (k != MAX_OUTPUT_CHANNELS) ) { s_editMode = 0; POPUP_MENU_START(onLimitsMenu, 5, STR_EDIT, STR_RESET, STR_COPY_TRIMS_TO_OFS, STR_COPY_STICKS_TO_OFS, STR_COPY_MIN_MAX_TO_OUTPUTS); } @@ -244,7 +243,6 @@ void menuModelLimits(event_t event) s_editMode = 0; if (event == EVT_KEY_LONG(KEY_ENTER)) { START_NO_HIGHLIGHT(); - killEvents(event); moveTrimsToOffsets(); // if highlighted and menu pressed - move trims to offsets } } diff --git a/radio/src/gui/128x64/model_select.cpp b/radio/src/gui/128x64/model_select.cpp index 9384f772c8b..cebb68b1b8c 100644 --- a/radio/src/gui/128x64/model_select.cpp +++ b/radio/src/gui/128x64/model_select.cpp @@ -141,7 +141,6 @@ void menuModelSelect(event_t event) break; case EVT_KEY_LONG(KEY_EXIT): - killEvents(event); if (s_copyMode && s_copyTgtOfs == 0 && g_eeGeneral.currModel != sub && modelExists(sub)) { POPUP_CONFIRMATION(STR_DELETEMODEL, nullptr); SET_WARNING_INFO(modelHeaders[sub].name, sizeof(g_model.header.name), 0); @@ -208,7 +207,6 @@ void menuModelSelect(event_t event) event == EVT_KEY_LONG(KEY_ENTER)) { s_copyMode = 0; - killEvents(event); if (g_eeGeneral.currModel != sub) { if (modelExists(sub)) { POPUP_MENU_ADD_ITEM(STR_SELECT_MODEL); @@ -240,36 +238,27 @@ void menuModelSelect(event_t event) } break; -#if defined(KEYS_GPIO_REG_PAGEDN) - case EVT_KEY_FIRST(KEY_PAGEUP): - chainMenu(menuTabModel[DIM(menuTabModel)-1].menuFunc); - killEvents(event); - break; - - case EVT_KEY_FIRST(KEY_PAGEDN): - chainMenu(menuModelSetup); - break; -#elif defined(KEYS_GPIO_REG_PAGE) - case EVT_KEY_LONG(KEY_PAGE): + case EVT_KEY_FIRST(KEY_LEFT): + // Page navigation only allowed if cursor on first line (for consistency) + if (sub != g_eeGeneral.currModel) { + AUDIO_WARNING2(); + break; + } + // Fallthrough + case EVT_KEY_BREAK(KEY_PAGEUP): chainMenu(menuTabModel[DIM(menuTabModel)-1].menuFunc); - killEvents(event); break; - case EVT_KEY_BREAK(KEY_PAGE): - chainMenu(menuModelSetup); - break; -#else - case EVT_KEY_FIRST(KEY_LEFT): case EVT_KEY_FIRST(KEY_RIGHT): - if (sub == g_eeGeneral.currModel) { - bool forward = (event == EVT_KEY_FIRST(KEY_RIGHT)); - chainMenu(forward ? menuModelSetup - : menuTabModel[DIM(menuTabModel) - 1].menuFunc); - } else { + // Page navigation only allowed if cursor on first line (for consistency) + if (sub != g_eeGeneral.currModel) { AUDIO_WARNING2(); + break; } + // Fallthrough + case EVT_KEY_BREAK(KEY_PAGEDN): + chainMenu(menuModelSetup); break; -#endif } if (s_copyMode) { diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 2e4da576e7c..ee6075078b9 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -39,13 +39,6 @@ #include "telemetry/crossfire.h" #endif -// TODO find why we need this (for REGISTER at least) -#if defined(PCBXLITE) - #define EVT_BUTTON_PRESSED() EVT_KEY_FIRST(KEY_ENTER) -#else - #define EVT_BUTTON_PRESSED() EVT_KEY_BREAK(KEY_ENTER) -#endif - uint8_t g_moduleIdx; uint8_t getSwitchWarningsCount() @@ -1010,7 +1003,6 @@ void menuModelSetup(event_t event) AUDIO_WARNING1(); storageDirty(EE_MODEL); } - killEvents(event); break; } } @@ -1065,7 +1057,6 @@ void menuModelSetup(event_t event) if (!READ_ONLY() && menuHorizontalPosition > 0) { switch (event) { case EVT_KEY_LONG(KEY_ENTER): - killEvents(event); if (g_model.potsWarnMode == POTS_WARN_MANUAL) { SAVE_POT_POSITION(menuHorizontalPosition-1); AUDIO_WARNING1(); @@ -1352,7 +1343,6 @@ void menuModelSetup(event_t event) // START_NO_HIGHLIGHT(); // telemetryErrors = 0; // AUDIO_WARNING1(); - // killEvents(event); // } // } break; @@ -1636,7 +1626,7 @@ void menuModelSetup(event_t event) lcdDrawText(lcdLastRightPos + 3, y, STR_MODULE_RANGE, (menuHorizontalPosition == 1 ? attr : 0)); if (attr) { if (moduleState[moduleIdx].mode == MODULE_MODE_NORMAL && s_editMode > 0) { - if (menuHorizontalPosition == 0 && event == EVT_BUTTON_PRESSED()) { + if (menuHorizontalPosition == 0 && event == EVT_KEY_BREAK(KEY_ENTER)) { startRegisterDialog(moduleIdx); } else if (menuHorizontalPosition == 1) { @@ -1739,7 +1729,6 @@ void menuModelSetup(event_t event) modelHeaders[g_eeGeneral.currModel].modelId[moduleIdx] = g_model.header.modelId[moduleIdx]; } else if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); uint8_t newVal = 0; #if defined(STORAGE_MODELSLIST) newVal = modelslist.findNextUnusedModelId(moduleIdx); @@ -1778,12 +1767,10 @@ void menuModelSetup(event_t event) if (isModuleR9MNonAccess(moduleIdx) || isModuleD16(moduleIdx) || isModuleAFHDS3(moduleIdx)) { #if defined(PCBXLITE) if (EVT_KEY_MASK(event) == KEY_ENTER) { -#elif defined(NAVIGATION_9X) - if (event == EVT_KEY_FIRST(KEY_ENTER)) { + killEvents(event); #else if (event == EVT_KEY_BREAK(KEY_ENTER)) { #endif - killEvents(event); #if defined(AFHDS3) if (isModuleAFHDS3(moduleIdx)) { startBindMenuAfhds3(moduleIdx); @@ -1874,7 +1861,6 @@ void menuModelSetup(event_t event) s_editMode = 0; if (moduleData.failsafeMode == FAILSAFE_CUSTOM) { if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); setCustomFailsafe(moduleIdx); AUDIO_WARNING1(); SEND_FAILSAFE_NOW(moduleIdx); @@ -2291,15 +2277,14 @@ void menuModelSetup(event_t event) case ITEM_MODEL_SETUP_USBJOYSTICK_CH_BUTTON: lcdDrawText(INDENT_WIDTH, y, BUTTON(TR_USBJOYSTICK_SETTINGS), attr); - if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) { + if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) { pushMenu(menuModelUSBJoystick); } break; case ITEM_MODEL_SETUP_USBJOYSTICK_APPLY: lcdDrawText(INDENT_WIDTH, y, BUTTON(TR_USBJOYSTICK_APPLY_CHANGES), attr); - if (attr && !READ_ONLY() && event == EVT_KEY_FIRST(KEY_ENTER)) { - killEvents(event); + if (attr && !READ_ONLY() && event == EVT_KEY_BREAK(KEY_ENTER)) { onUSBJoystickModelChanged(); } break; diff --git a/radio/src/gui/128x64/model_special_functions.cpp b/radio/src/gui/128x64/model_special_functions.cpp index 84789b08136..605edbe4bd8 100644 --- a/radio/src/gui/128x64/model_special_functions.cpp +++ b/radio/src/gui/128x64/model_special_functions.cpp @@ -166,7 +166,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF #else if (menuHorizontalPosition<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) { #endif - killEvents(event); CustomFunctionData *cfn = &functions[sub]; if (!CFN_EMPTY(cfn)) POPUP_MENU_ADD_ITEM(STR_COPY); @@ -416,7 +415,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF #if !defined(NAVIGATION_X7) // For X7 type navigation the ENTER long press is handled below if (attr && event==EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); s_editMode = !s_editMode; active = true; CFN_GVAR_MODE(cfn) += 1; @@ -433,7 +431,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF if (active || event==EVT_KEY_LONG(KEY_ENTER)) { CFN_PARAM(cfn) = CHECK_INCDEC_PARAM(event, val_displayed, val_min, val_max); if (func == FUNC_ADJUST_GVAR && attr && event==EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); if (CFN_GVAR_MODE(cfn) != FUNC_ADJUST_GVAR_CONSTANT) POPUP_MENU_ADD_ITEM(STR_CONSTANT); if (CFN_GVAR_MODE(cfn) != FUNC_ADJUST_GVAR_SOURCE) diff --git a/radio/src/gui/128x64/model_telemetry.cpp b/radio/src/gui/128x64/model_telemetry.cpp index 2913b5b53d3..2ddb93b0a96 100644 --- a/radio/src/gui/128x64/model_telemetry.cpp +++ b/radio/src/gui/128x64/model_telemetry.cpp @@ -173,7 +173,6 @@ void menuModelTelemetry(event_t event) s_editMode = 0; s_currIdx = index; if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); POPUP_MENU_START(onSensorMenu, 3, STR_EDIT, STR_COPY, STR_DELETE); } else if (event == EVT_KEY_BREAK(KEY_ENTER)) { @@ -226,7 +225,6 @@ void menuModelTelemetry(event_t event) if (attr) { s_editMode = 0; if (event == EVT_KEY_BREAK(KEY_ENTER)) { - killEvents(KEY_ENTER); POPUP_CONFIRMATION(STR_CONFIRMDELETE, onDeleteAllSensorsConfirm); } } diff --git a/radio/src/gui/128x64/radio_diaganas.cpp b/radio/src/gui/128x64/radio_diaganas.cpp index a9342180c4c..b9204be6922 100644 --- a/radio/src/gui/128x64/radio_diaganas.cpp +++ b/radio/src/gui/128x64/radio_diaganas.cpp @@ -41,7 +41,6 @@ void menuRadioDiagAnalogs(event_t event) switch (event) { case EVT_KEY_FIRST(KEY_RIGHT): case EVT_KEY_BREAK(KEY_PAGEDN): - case EVT_KEY_BREAK(KEY_PAGE): { if (viewpage == ANAVIEW_LAST) viewpage = ANAVIEW_FIRST; @@ -53,7 +52,6 @@ void menuRadioDiagAnalogs(event_t event) case EVT_KEY_FIRST(KEY_LEFT): case EVT_KEY_BREAK(KEY_PAGEUP): - case EVT_KEY_LONG(KEY_PAGE): { if (viewpage == ANAVIEW_FIRST) viewpage = ANAVIEW_LAST; diff --git a/radio/src/gui/128x64/radio_setup.cpp b/radio/src/gui/128x64/radio_setup.cpp index 9ca7cc7a86f..71777add370 100644 --- a/radio/src/gui/128x64/radio_setup.cpp +++ b/radio/src/gui/128x64/radio_setup.cpp @@ -143,8 +143,8 @@ void menuRadioSetup(event_t event) if ((menuVerticalPosition == ITEM_RADIO_SETUP_DATE + HEADER_LINE || menuVerticalPosition == ITEM_RADIO_SETUP_TIME + HEADER_LINE) && (s_editMode > 0) && - (event == EVT_KEY_FIRST(KEY_ENTER) || event == EVT_KEY_LONG(KEY_ENTER) || - event == EVT_KEY_FIRST(KEY_EXIT))) { + (event == EVT_KEY_BREAK(KEY_ENTER) || event == EVT_KEY_LONG(KEY_ENTER) || + event == EVT_KEY_BREAK(KEY_EXIT))) { // set the date and time into RTC chip rtcSetTime(&t); } diff --git a/radio/src/gui/128x64/view_about.cpp b/radio/src/gui/128x64/view_about.cpp index 24a9aab81ae..7d16ec6494d 100644 --- a/radio/src/gui/128x64/view_about.cpp +++ b/radio/src/gui/128x64/view_about.cpp @@ -36,8 +36,8 @@ void menuAboutView(event_t event) { switch(event) { - case EVT_KEY_FIRST(KEY_EXIT): - case EVT_KEY_FIRST(KEY_ENTER): + case EVT_KEY_BREAK(KEY_EXIT): + case EVT_KEY_BREAK(KEY_ENTER): chainMenu(menuMainView); break; } diff --git a/radio/src/gui/128x64/view_channels.cpp b/radio/src/gui/128x64/view_channels.cpp index 2d2b339caf4..e4630eb16f0 100644 --- a/radio/src/gui/128x64/view_channels.cpp +++ b/radio/src/gui/128x64/view_channels.cpp @@ -38,8 +38,8 @@ constexpr coord_t CHANNEL_PROPERTIES_OFFSET = CHANNEL_GAUGE_OFFSET + CHANNEL_BAR #define EVT_KEY_NEXT_PAGE EVT_ROTARY_RIGHT #define EVT_KEY_PREVIOUS_PAGE EVT_ROTARY_LEFT #elif defined(NAVIGATION_X7) -#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_LONG(KEY_PAGE) -#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGE) +#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_BREAK(KEY_PAGEUP) +#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGEDN) #define EVT_KEY_NEXT_PAGE EVT_ROTARY_RIGHT #define EVT_KEY_PREVIOUS_PAGE EVT_ROTARY_LEFT #elif defined(NAVIGATION_XLITE) diff --git a/radio/src/gui/128x64/view_main.cpp b/radio/src/gui/128x64/view_main.cpp index dc09db37d6c..fccd543226e 100644 --- a/radio/src/gui/128x64/view_main.cpp +++ b/radio/src/gui/128x64/view_main.cpp @@ -304,29 +304,29 @@ void displayBattVoltage() #if defined(RADIO_T8) || defined(RADIO_COMMANDO8) #define EVT_KEY_CONTEXT_MENU EVT_KEY_LONG(KEY_ENTER) #define EVT_KEY_PREVIOUS_VIEW EVT_KEY_BREAK(KEY_PAGEUP) -#define EVT_KEY_NEXT_VIEW EVT_KEY_FIRST(KEY_PAGEDN) -#define EVT_KEY_NEXT_PAGE EVT_KEY_FIRST(KEY_PLUS) -#define EVT_KEY_PREVIOUS_PAGE EVT_KEY_FIRST(KEY_MINUS) -#define EVT_KEY_MODEL_MENU EVT_KEY_FIRST(KEY_MODEL) -#define EVT_KEY_GENERAL_MENU EVT_KEY_FIRST(KEY_SYS) +#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGEDN) +#define EVT_KEY_NEXT_PAGE EVT_KEY_BREAK(KEY_PLUS) +#define EVT_KEY_PREVIOUS_PAGE EVT_KEY_BREAK(KEY_MINUS) +#define EVT_KEY_MODEL_MENU EVT_KEY_BREAK(KEY_MODEL) +#define EVT_KEY_GENERAL_MENU EVT_KEY_BREAK(KEY_SYS) #define EVT_KEY_TELEMETRY EVT_KEY_LONG(KEY_PAGEUP) #elif defined(NAVIGATION_X7_TX12) #define EVT_KEY_CONTEXT_MENU EVT_KEY_LONG(KEY_ENTER) -#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_FIRST(KEY_PAGEUP) -#define EVT_KEY_NEXT_VIEW EVT_KEY_FIRST(KEY_PAGEDN) +#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_BREAK(KEY_PAGEUP) +#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGEDN) #define EVT_KEY_NEXT_PAGE EVT_ROTARY_RIGHT #define EVT_KEY_PREVIOUS_PAGE EVT_ROTARY_LEFT -#define EVT_KEY_MODEL_MENU EVT_KEY_FIRST(KEY_MODEL) -#define EVT_KEY_GENERAL_MENU EVT_KEY_FIRST(KEY_SYS) -#define EVT_KEY_TELEMETRY EVT_KEY_FIRST(KEY_TELE) +#define EVT_KEY_MODEL_MENU EVT_KEY_BREAK(KEY_MODEL) +#define EVT_KEY_GENERAL_MENU EVT_KEY_BREAK(KEY_SYS) +#define EVT_KEY_TELEMETRY EVT_KEY_BREAK(KEY_TELE) #elif defined(NAVIGATION_X7) || defined(NAVIGATION_TBS) #define EVT_KEY_CONTEXT_MENU EVT_KEY_LONG(KEY_ENTER) -#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGE) +#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGEDN) #define EVT_KEY_NEXT_PAGE EVT_ROTARY_RIGHT #define EVT_KEY_PREVIOUS_PAGE EVT_ROTARY_LEFT #define EVT_KEY_MODEL_MENU EVT_KEY_BREAK(KEY_MENU) #define EVT_KEY_GENERAL_MENU EVT_KEY_LONG(KEY_MENU) -#define EVT_KEY_TELEMETRY EVT_KEY_LONG(KEY_PAGE) +#define EVT_KEY_TELEMETRY EVT_KEY_BREAK(KEY_PAGEUP) #elif defined(NAVIGATION_XLITE) #define EVT_KEY_CONTEXT_MENU EVT_KEY_LONG(KEY_ENTER) #define EVT_KEY_PREVIOUS_VIEW EVT_KEY_BREAK(KEY_UP) @@ -447,8 +447,6 @@ void menuMainView(event_t event) break; case EVT_KEY_CONTEXT_MENU: - killEvents(event); - if (modelHasNotes()) { POPUP_MENU_ADD_ITEM(STR_VIEW_NOTES); } @@ -459,18 +457,15 @@ void menuMainView(event_t event) #if defined(EVT_KEY_LAST_MENU) case EVT_KEY_LAST_MENU: pushMenu(lastPopMenu()); - killEvents(event); break; #endif case EVT_KEY_MODEL_MENU: pushMenu(menuModelSelect); - killEvents(event); break; case EVT_KEY_GENERAL_MENU: pushMenu(menuTabGeneral[0].menuFunc); - killEvents(event); break; #if defined(EVT_KEY_PREVIOUS_VIEW) @@ -492,13 +487,11 @@ void menuMainView(event_t event) #if defined(EVT_KEY_STATISTICS) case EVT_KEY_STATISTICS: chainMenu(menuStatisticsView); - killEvents(event); break; #endif case EVT_KEY_TELEMETRY: chainMenu(menuViewTelemetry); - killEvents(event); break; diff --git a/radio/src/gui/128x64/view_statistics.cpp b/radio/src/gui/128x64/view_statistics.cpp index baf84be4d34..668c7a0a4b4 100644 --- a/radio/src/gui/128x64/view_statistics.cpp +++ b/radio/src/gui/128x64/view_statistics.cpp @@ -40,27 +40,13 @@ void menuStatisticsView(event_t event) switch (event) { case EVT_KEY_FIRST(KEY_UP): -#if defined(KEYS_GPIO_REG_PAGEDN) case EVT_KEY_BREAK(KEY_PAGEDN): -#elif defined(NAVIGATION_X7) - case EVT_KEY_BREAK(KEY_PAGE): -#endif - chainMenu(menuStatisticsDebug); break; case EVT_KEY_FIRST(KEY_DOWN): -#if defined(KEYS_GPIO_REG_PAGEUP) case EVT_KEY_BREAK(KEY_PAGEUP): - killEvents(event); - chainMenu(menuStatisticsDebug2); -#elif defined(NAVIGATION_X7) - case EVT_KEY_LONG(KEY_PAGE): - killEvents(event); chainMenu(menuStatisticsDebug2); -#else - chainMenu(menuStatisticsDebug); -#endif break; case EVT_KEY_LONG(KEY_ENTER): @@ -69,7 +55,7 @@ void menuStatisticsView(event_t event) sessionTimer = 0; break; - case EVT_KEY_FIRST(KEY_EXIT): + case EVT_KEY_BREAK(KEY_EXIT): chainMenu(menuMainView); break; } @@ -128,10 +114,9 @@ void menuStatisticsDebug(event_t event) g_eeGeneral.globalTimer = 0; sessionTimer = 0; storageDirty(EE_GENERAL); - killEvents(event); break; - case EVT_KEY_FIRST(KEY_ENTER): + case EVT_KEY_BREAK(KEY_ENTER): #if defined(LUA) maxLuaInterval = 0; maxLuaDuration = 0; @@ -140,30 +125,18 @@ void menuStatisticsDebug(event_t event) break; case EVT_KEY_FIRST(KEY_UP): -#if defined(KEYS_GPIO_REG_PAGEDN) case EVT_KEY_BREAK(KEY_PAGEDN): disableVBatBridge(); chainMenu(menuStatisticsDebug2); break; -#elif defined(NAVIGATION_X7) - case EVT_KEY_BREAK(KEY_PAGE): - disableVBatBridge(); - chainMenu(menuStatisticsDebug2); - break; -#endif case EVT_KEY_FIRST(KEY_DOWN): -#if defined(KEYS_GPIO_REG_PAGEUP) case EVT_KEY_BREAK(KEY_PAGEUP): -#elif defined(NAVIGATION_X7) - case EVT_KEY_LONG(KEY_PAGE): -#endif - killEvents(event); disableVBatBridge(); chainMenu(menuStatisticsView); break; - case EVT_KEY_FIRST(KEY_EXIT): + case EVT_KEY_BREAK(KEY_EXIT): disableVBatBridge(); chainMenu(menuMainView); break; @@ -221,30 +194,21 @@ void menuStatisticsDebug2(event_t event) title(STR_MENUDEBUG); switch(event) { - // case EVT_KEY_FIRST(KEY_ENTER): + // case EVT_KEY_BREAK(KEY_ENTER): // telemetryErrors = 0; // break; case EVT_KEY_FIRST(KEY_UP): -#if defined(KEYS_GPIO_REG_PAGEDN) case EVT_KEY_BREAK(KEY_PAGEDN): -#elif defined(NAVIGATION_X7) - case EVT_KEY_BREAK(KEY_PAGE): -#endif chainMenu(menuStatisticsView); return; case EVT_KEY_FIRST(KEY_DOWN): -#if defined(KEYS_GPIO_REG_PAGEUP) case EVT_KEY_BREAK(KEY_PAGEUP): -#elif defined(NAVIGATION_X7) - case EVT_KEY_LONG(KEY_PAGE): -#endif - killEvents(event); chainMenu(menuStatisticsDebug); break; - case EVT_KEY_FIRST(KEY_EXIT): + case EVT_KEY_BREAK(KEY_EXIT): chainMenu(menuMainView); break; } diff --git a/radio/src/gui/212x64/model_curve_edit.cpp b/radio/src/gui/212x64/model_curve_edit.cpp index 10b12ffc050..1c29769acae 100644 --- a/radio/src/gui/212x64/model_curve_edit.cpp +++ b/radio/src/gui/212x64/model_curve_edit.cpp @@ -161,14 +161,12 @@ void menuModelCurveOne(event_t event) case EVT_KEY_LONG(KEY_ENTER): if (menuVerticalPosition > 1) { - killEvents(event); POPUP_MENU_START(onCurveOneMenu, 3, STR_CURVE_PRESET, STR_MIRROR, STR_CLEAR); } break; case EVT_KEY_LONG(KEY_MENU): pushMenu(menuChannelsView); - killEvents(event); break; } diff --git a/radio/src/gui/212x64/model_custom_scripts.cpp b/radio/src/gui/212x64/model_custom_scripts.cpp index 33fffd37415..78068bec311 100644 --- a/radio/src/gui/212x64/model_custom_scripts.cpp +++ b/radio/src/gui/212x64/model_custom_scripts.cpp @@ -131,7 +131,7 @@ void menuModelCustomScripts(event_t event) coord_t y; int8_t sub = menuVerticalPosition; - if (event == EVT_KEY_FIRST(KEY_ENTER)) { + if (event == EVT_KEY_BREAK(KEY_ENTER)) { s_currIdx = sub; pushMenu(menuModelCustomScriptOne); } diff --git a/radio/src/gui/212x64/model_failsafe.cpp b/radio/src/gui/212x64/model_failsafe.cpp index 5fa5190b6dd..61568e6a70b 100644 --- a/radio/src/gui/212x64/model_failsafe.cpp +++ b/radio/src/gui/212x64/model_failsafe.cpp @@ -37,7 +37,6 @@ void menuModelFailsafe(event_t event) break; case EVT_KEY_LONG(KEY_ENTER): - killEvents(event); event = 0; if (menuVerticalPosition < sentModuleChannels(g_moduleIdx)) { diff --git a/radio/src/gui/212x64/model_flightmodes.cpp b/radio/src/gui/212x64/model_flightmodes.cpp index acce5bd2084..441e1613577 100644 --- a/radio/src/gui/212x64/model_flightmodes.cpp +++ b/radio/src/gui/212x64/model_flightmodes.cpp @@ -76,10 +76,9 @@ void menuModelFlightModesAll(event_t event) drawFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, mixerCurrentFlightMode+1); if (sub == MAX_FLIGHT_MODES) { if (!trimsCheckTimer) { - if (event == EVT_KEY_FIRST(KEY_ENTER)) { + if (event == EVT_KEY_BREAK(KEY_ENTER)) { trimsCheckTimer = 200; // 2 seconds trims cancelled s_editMode = 1; - killEvents(event); } else { lcdInvertLastLine(); @@ -87,10 +86,9 @@ void menuModelFlightModesAll(event_t event) } } else { - if (event == EVT_KEY_FIRST(KEY_EXIT)) { + if (event == EVT_KEY_BREAK(KEY_EXIT)) { trimsCheckTimer = 0; s_editMode = 0; - killEvents(event); } } } diff --git a/radio/src/gui/212x64/model_gvars.cpp b/radio/src/gui/212x64/model_gvars.cpp index 852b92a9541..c0d0f0cd9e3 100644 --- a/radio/src/gui/212x64/model_gvars.cpp +++ b/radio/src/gui/212x64/model_gvars.cpp @@ -197,7 +197,6 @@ void menuModelGVars(event_t event) } if ((menuHorizontalPosition<0 || !modelFMEnabled()) && event==EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); POPUP_MENU_START(onGVARSMenu, 2, STR_EDIT, STR_CLEAR); } } diff --git a/radio/src/gui/212x64/model_input_edit.cpp b/radio/src/gui/212x64/model_input_edit.cpp index 78705292db4..ed35089a2d4 100644 --- a/radio/src/gui/212x64/model_input_edit.cpp +++ b/radio/src/gui/212x64/model_input_edit.cpp @@ -59,7 +59,6 @@ void menuModelExpoOne(event_t event) { if (event == EVT_KEY_LONG(KEY_MENU)) { pushMenu(menuChannelsView); - killEvents(event); } ExpoData * ed = expoAddress(s_currIdx); diff --git a/radio/src/gui/212x64/model_logical_switches.cpp b/radio/src/gui/212x64/model_logical_switches.cpp index 797858964a4..72899ae7db4 100644 --- a/radio/src/gui/212x64/model_logical_switches.cpp +++ b/radio/src/gui/212x64/model_logical_switches.cpp @@ -89,7 +89,6 @@ void menuModelLogicalSwitches(event_t event) } if (horz<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) { - killEvents(event); LogicalSwitchData * cs = lswAddress(sub); if (cs->func) POPUP_MENU_ADD_ITEM(STR_COPY); @@ -233,7 +232,6 @@ void menuModelLogicalSwitches(event_t event) } cs->v2 = CHECK_INCDEC_PARAM(event, cs->v2, v2_min, v2_max); if (cstate==LS_FAMILY_OFS && cs->v1!=0 && event==EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); getvalue_t x = getValue(v1_val); if (abs(v1_val) <= MIXSRC_LAST_CH) { cs->v2 = calcRESXto100(x); diff --git a/radio/src/gui/212x64/model_mix_edit.cpp b/radio/src/gui/212x64/model_mix_edit.cpp index 90398472d48..a8b23da4a62 100644 --- a/radio/src/gui/212x64/model_mix_edit.cpp +++ b/radio/src/gui/212x64/model_mix_edit.cpp @@ -92,7 +92,6 @@ void menuModelMixOne(event_t event) { if (event == EVT_KEY_LONG(KEY_MENU)) { pushMenu(menuChannelsView); - killEvents(event); } MixData * md2 = mixAddress(s_currIdx) ; diff --git a/radio/src/gui/212x64/model_outputs.cpp b/radio/src/gui/212x64/model_outputs.cpp index 05a21f08b78..1717885b13d 100644 --- a/radio/src/gui/212x64/model_outputs.cpp +++ b/radio/src/gui/212x64/model_outputs.cpp @@ -128,7 +128,6 @@ void menuModelLimits(event_t event) s_editMode = 0; if (event==EVT_KEY_LONG(KEY_ENTER)) { START_NO_HIGHLIGHT(); - killEvents(event); moveTrimsToOffsets(); // if highlighted and menu pressed - move trims to offsets } } @@ -147,7 +146,6 @@ void menuModelLimits(event_t event) putsChn(0, y, k+1, (sub==k && menuHorizontalPosition < 0) ? INVERS : 0); if (sub==k && menuHorizontalPosition < 0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) { - killEvents(event); POPUP_MENU_START(onLimitsMenu, 4, STR_RESET, STR_COPY_TRIMS_TO_OFS, STR_COPY_STICKS_TO_OFS, STR_COPY_MIN_MAX_TO_OUTPUTS); } diff --git a/radio/src/gui/212x64/model_select.cpp b/radio/src/gui/212x64/model_select.cpp index fe24899c8c8..3cb68bd4dd6 100644 --- a/radio/src/gui/212x64/model_select.cpp +++ b/radio/src/gui/212x64/model_select.cpp @@ -142,7 +142,6 @@ void menuModelSelect(event_t event) strcat_modelname (nametmp, sub, 0); POPUP_CONFIRMATION(STR_DELETEMODEL, nullptr); SET_WARNING_INFO(nametmp, sizeof(g_model.header.name), 0); - killEvents(event); break; } // no break @@ -202,7 +201,6 @@ void menuModelSelect(event_t event) } else if (event == EVT_KEY_LONG(KEY_ENTER)) { s_copyMode = 0; - killEvents(event); if (g_eeGeneral.currModel != sub) { if (modelExists(sub)) { POPUP_MENU_ADD_ITEM(STR_SELECT_MODEL); @@ -230,12 +228,11 @@ void menuModelSelect(event_t event) } break; - case EVT_KEY_BREAK(KEY_PAGE): - case EVT_KEY_LONG(KEY_PAGE): - chainMenu(event == EVT_KEY_BREAK(KEY_PAGE) + case EVT_KEY_BREAK(KEY_PAGEDN): + case EVT_KEY_BREAK(KEY_PAGEUP): + chainMenu(event == EVT_KEY_BREAK(KEY_PAGEDN) ? menuModelSetup : menuTabModel[DIM(menuTabModel) - 1].menuFunc); - killEvents(event); break; } diff --git a/radio/src/gui/212x64/model_setup.cpp b/radio/src/gui/212x64/model_setup.cpp index e6258a54d10..328218ce8bc 100644 --- a/radio/src/gui/212x64/model_setup.cpp +++ b/radio/src/gui/212x64/model_setup.cpp @@ -896,7 +896,6 @@ void menuModelSetup(event_t event) AUDIO_WARNING1(); storageDirty(EE_MODEL); } - killEvents(event); break; } } @@ -961,7 +960,6 @@ void menuModelSetup(event_t event) if (!READ_ONLY() && menuHorizontalPosition > 0) { switch (event) { case EVT_KEY_LONG(KEY_ENTER): - killEvents(event); if (g_model.potsWarnMode == POTS_WARN_MANUAL) { SAVE_POT_POSITION(menuHorizontalPosition-1); AUDIO_WARNING1(); @@ -1292,7 +1290,6 @@ void menuModelSetup(event_t event) // START_NO_HIGHLIGHT(); // telemetryErrors = 0; // AUDIO_WARNING1(); - // killEvents(event); // } // } break; @@ -1552,7 +1549,6 @@ void menuModelSetup(event_t event) modelHeaders[g_eeGeneral.currModel].modelId[moduleIdx] = g_model.header.modelId[moduleIdx]; } else if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); uint8_t newVal = findNextUnusedModelId(g_eeGeneral.currModel, moduleIdx); if (newVal != g_model.header.modelId[moduleIdx]) { modelHeaders[g_eeGeneral.currModel].modelId[moduleIdx] = g_model.header.modelId[moduleIdx] = newVal; @@ -1660,7 +1656,6 @@ void menuModelSetup(event_t event) s_editMode = 0; if (moduleData.failsafeMode == FAILSAFE_CUSTOM) { if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); setCustomFailsafe(moduleIdx); AUDIO_WARNING1(); SEND_FAILSAFE_NOW(moduleIdx); @@ -2016,15 +2011,14 @@ void menuModelSetup(event_t event) case ITEM_MODEL_SETUP_USBJOYSTICK_CH_BUTTON: lcdDrawText(INDENT_WIDTH, y, BUTTON(TR_USBJOYSTICK_SETTINGS), attr); - if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) { + if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) { pushMenu(menuModelUSBJoystick); } break; case ITEM_MODEL_SETUP_USBJOYSTICK_APPLY: lcdDrawText(INDENT_WIDTH, y, BUTTON(TR_USBJOYSTICK_APPLY_CHANGES), attr); - if (attr && !READ_ONLY() && event == EVT_KEY_FIRST(KEY_ENTER)) { - killEvents(event); + if (attr && !READ_ONLY() && event == EVT_KEY_BREAK(KEY_ENTER)) { onUSBJoystickModelChanged(); } break; diff --git a/radio/src/gui/212x64/model_special_functions.cpp b/radio/src/gui/212x64/model_special_functions.cpp index 4067b01ee9d..1729f7159be 100644 --- a/radio/src/gui/212x64/model_special_functions.cpp +++ b/radio/src/gui/212x64/model_special_functions.cpp @@ -155,7 +155,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF int sub = menuVerticalPosition; uint8_t eeFlags = (functions == g_model.customFn) ? EE_MODEL : EE_GENERAL; if (menuHorizontalPosition<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) { - killEvents(event); CustomFunctionData *cfn = &functions[sub]; if (!CFN_EMPTY(cfn)) POPUP_MENU_ADD_ITEM(STR_COPY); @@ -396,7 +395,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF if (active || event==EVT_KEY_LONG(KEY_ENTER)) { CFN_PARAM(cfn) = CHECK_INCDEC_PARAM(event, val_displayed, val_min, val_max); if (func == FUNC_ADJUST_GVAR && attr && event==EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); if (CFN_GVAR_MODE(cfn) != FUNC_ADJUST_GVAR_CONSTANT) POPUP_MENU_ADD_ITEM(STR_CONSTANT); if (CFN_GVAR_MODE(cfn) != FUNC_ADJUST_GVAR_SOURCE) diff --git a/radio/src/gui/212x64/model_telemetry.cpp b/radio/src/gui/212x64/model_telemetry.cpp index 642c65f1518..c8c8703408a 100644 --- a/radio/src/gui/212x64/model_telemetry.cpp +++ b/radio/src/gui/212x64/model_telemetry.cpp @@ -160,7 +160,6 @@ void menuModelTelemetry(event_t event) s_editMode = 0; s_currIdx = index; if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); POPUP_MENU_START(onSensorMenu, 3, STR_EDIT, STR_COPY, STR_DELETE); } else if (event == EVT_KEY_BREAK(KEY_ENTER)) { @@ -211,7 +210,6 @@ void menuModelTelemetry(event_t event) if (attr) { s_editMode = 0; if (event == EVT_KEY_BREAK(KEY_ENTER)) { - killEvents(KEY_ENTER); POPUP_CONFIRMATION(STR_CONFIRMDELETE, onDeleteAllSensorsConfirm); } } diff --git a/radio/src/gui/212x64/radio_diaganas.cpp b/radio/src/gui/212x64/radio_diaganas.cpp index f8f1605d123..7c3c460ff7f 100644 --- a/radio/src/gui/212x64/radio_diaganas.cpp +++ b/radio/src/gui/212x64/radio_diaganas.cpp @@ -38,7 +38,7 @@ void menuRadioDiagAnalogs(event_t event) static int viewpage = ANAVIEW_FIRST; - if (event == EVT_KEY_BREAK(KEY_PAGE)) { + if (event == EVT_KEY_BREAK(KEY_PAGEDN)) { if (viewpage == ANAVIEW_LAST) viewpage = ANAVIEW_FIRST; else diff --git a/radio/src/gui/212x64/radio_setup.cpp b/radio/src/gui/212x64/radio_setup.cpp index dc32976dfef..84efc7598a8 100644 --- a/radio/src/gui/212x64/radio_setup.cpp +++ b/radio/src/gui/212x64/radio_setup.cpp @@ -136,7 +136,7 @@ void menuRadioSetup(event_t event) if ((menuVerticalPosition==ITEM_RADIO_SETUP_DATE || menuVerticalPosition==ITEM_RADIO_SETUP_TIME) && (s_editMode>0) && - (event==EVT_KEY_FIRST(KEY_ENTER) || event==EVT_KEY_BREAK(KEY_ENTER) || event==EVT_KEY_LONG(KEY_ENTER) || event==EVT_KEY_FIRST(KEY_EXIT))) { + (event==EVT_KEY_BREAK(KEY_ENTER) || event==EVT_KEY_BREAK(KEY_ENTER) || event==EVT_KEY_LONG(KEY_ENTER) || event==EVT_KEY_BREAK(KEY_EXIT))) { // set the date and time into RTC chip rtcSetTime(&t); } diff --git a/radio/src/gui/212x64/view_about.cpp b/radio/src/gui/212x64/view_about.cpp index 505e46d8894..f7954299108 100644 --- a/radio/src/gui/212x64/view_about.cpp +++ b/radio/src/gui/212x64/view_about.cpp @@ -36,8 +36,8 @@ void menuAboutView(event_t event) { switch(event) { - case EVT_KEY_FIRST(KEY_ENTER): - case EVT_KEY_FIRST(KEY_EXIT): + case EVT_KEY_BREAK(KEY_ENTER): + case EVT_KEY_BREAK(KEY_EXIT): chainMenu(menuMainView); break; } diff --git a/radio/src/gui/212x64/view_channels.cpp b/radio/src/gui/212x64/view_channels.cpp index 2972eb6f70d..22289d2360f 100644 --- a/radio/src/gui/212x64/view_channels.cpp +++ b/radio/src/gui/212x64/view_channels.cpp @@ -51,7 +51,7 @@ void menuChannelsView(event_t event) viewChannels.secondPage = !viewChannels.secondPage; break; - case EVT_KEY_FIRST(KEY_ENTER): + case EVT_KEY_BREAK(KEY_ENTER): viewChannels.mixersView = !viewChannels.mixersView; break; } diff --git a/radio/src/gui/212x64/view_main.cpp b/radio/src/gui/212x64/view_main.cpp index bf3d90d308d..1b3087f0840 100644 --- a/radio/src/gui/212x64/view_main.cpp +++ b/radio/src/gui/212x64/view_main.cpp @@ -383,7 +383,7 @@ void displayTimers() void menuMainViewChannelsMonitor(event_t event) { switch(event) { - case EVT_KEY_BREAK(KEY_PAGE): + case EVT_KEY_BREAK(KEY_PAGEDN): case EVT_KEY_BREAK(KEY_EXIT): chainMenu(menuMainView); event = 0; @@ -472,7 +472,6 @@ void menuMainView(event_t event) break; case EVT_KEY_LONG(KEY_ENTER): - killEvents(event); if (modelHasNotes()) { POPUP_MENU_ADD_ITEM(STR_VIEW_NOTES); } @@ -485,10 +484,9 @@ void menuMainView(event_t event) case EVT_KEY_LONG(KEY_MENU): pushMenu(menuTabGeneral[0].menuFunc); - killEvents(event); break; - case EVT_KEY_BREAK(KEY_PAGE): + case EVT_KEY_BREAK(KEY_PAGEDN): storageDirty(EE_MODEL); g_model.view += 1; if (g_model.view >= VIEW_COUNT) { @@ -497,9 +495,8 @@ void menuMainView(event_t event) } break; - case EVT_KEY_LONG(KEY_PAGE): + case EVT_KEY_BREAK(KEY_PAGEUP): chainMenu(menuViewTelemetry); - killEvents(event); break; case EVT_KEY_FIRST(KEY_EXIT): diff --git a/radio/src/gui/212x64/view_statistics.cpp b/radio/src/gui/212x64/view_statistics.cpp index ee6048c641a..6ebb2658479 100644 --- a/radio/src/gui/212x64/view_statistics.cpp +++ b/radio/src/gui/212x64/view_statistics.cpp @@ -33,14 +33,13 @@ void menuStatisticsView(event_t event) title(STR_MENUSTAT); switch(event) { - case EVT_KEY_FIRST(KEY_PLUS): - case EVT_KEY_BREAK(KEY_PAGE): + case EVT_KEY_BREAK(KEY_PLUS): + case EVT_KEY_BREAK(KEY_PAGEDN): chainMenu(menuStatisticsDebug); break; - case EVT_KEY_FIRST(KEY_MINUS): - case EVT_KEY_LONG(KEY_PAGE): - killEvents(event); + case EVT_KEY_BREAK(KEY_MINUS): + case EVT_KEY_BREAK(KEY_PAGEUP): #if defined(DEBUG_TRACE_BUFFER) chainMenu(menuTraceBuffer); #else @@ -55,7 +54,7 @@ void menuStatisticsView(event_t event) sessionTimer = 0; break; - case EVT_KEY_FIRST(KEY_EXIT): + case EVT_KEY_BREAK(KEY_EXIT): chainMenu(menuMainView); break; } @@ -123,10 +122,9 @@ void menuStatisticsDebug(event_t event) g_eeGeneral.globalTimer = 0; sessionTimer = 0; storageDirty(EE_GENERAL); - killEvents(event); break; - case EVT_KEY_FIRST(KEY_ENTER): + case EVT_KEY_BREAK(KEY_ENTER): #if defined(LUA) maxLuaInterval = 0; maxLuaDuration = 0; @@ -134,20 +132,19 @@ void menuStatisticsDebug(event_t event) maxMixerDuration = 0; break; - case EVT_KEY_FIRST(KEY_PLUS): - case EVT_KEY_BREAK(KEY_PAGE): + case EVT_KEY_BREAK(KEY_PLUS): + case EVT_KEY_BREAK(KEY_PAGEDN): disableVBatBridge(); chainMenu(menuStatisticsDebug2); break; - case EVT_KEY_FIRST(KEY_MINUS): - case EVT_KEY_LONG(KEY_PAGE): - killEvents(event); + case EVT_KEY_BREAK(KEY_MINUS): + case EVT_KEY_BREAK(KEY_PAGEUP): disableVBatBridge(); chainMenu(menuStatisticsView); break; - case EVT_KEY_FIRST(KEY_EXIT): + case EVT_KEY_BREAK(KEY_EXIT): disableVBatBridge(); chainMenu(menuMainView); break; @@ -217,8 +214,8 @@ void menuStatisticsDebug2(event_t event) title(STR_MENUDEBUG); switch(event) { - case EVT_KEY_FIRST(KEY_PLUS): - case EVT_KEY_BREAK(KEY_PAGE): + case EVT_KEY_BREAK(KEY_PLUS): + case EVT_KEY_BREAK(KEY_PAGEDN): #if defined(DEBUG_TRACE_BUFFER) chainMenu(menuTraceBuffer); #else @@ -226,13 +223,12 @@ void menuStatisticsDebug2(event_t event) #endif return; - case EVT_KEY_FIRST(KEY_MINUS): - case EVT_KEY_LONG(KEY_PAGE): - killEvents(event); + case EVT_KEY_BREAK(KEY_MINUS): + case EVT_KEY_BREAK(KEY_PAGEUP): chainMenu(menuStatisticsDebug); break; - case EVT_KEY_FIRST(KEY_EXIT): + case EVT_KEY_BREAK(KEY_EXIT): chainMenu(menuMainView); break; @@ -257,17 +253,15 @@ void menuTraceBuffer(event_t event) { case EVT_KEY_LONG(KEY_ENTER): dumpTraceBuffer(); - killEvents(event); break; - case EVT_KEY_FIRST(KEY_MINUS): - case EVT_KEY_LONG(KEY_PAGE): - killEvents(event); + case EVT_KEY_BREAK(KEY_MINUS): + case EVT_KEY_BREAK(KEY_PAGEUP): chainMenu(menuStatisticsDebug2); break; - case EVT_KEY_FIRST(KEY_PLUS): - case EVT_KEY_BREAK(KEY_PAGE): + case EVT_KEY_BREAK(KEY_PLUS): + case EVT_KEY_BREAK(KEY_PAGEDN): chainMenu(menuStatisticsView); return; } diff --git a/radio/src/gui/colorlcd/LvglWrapper.cpp b/radio/src/gui/colorlcd/LvglWrapper.cpp index c5819615624..293eed71465 100644 --- a/radio/src/gui/colorlcd/LvglWrapper.cpp +++ b/radio/src/gui/colorlcd/LvglWrapper.cpp @@ -111,7 +111,6 @@ static void dispatch_kb_event(Window* w, event_t evt) } else if (key != KEY_ENTER) { w->onEvent(evt); } else if (evt == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(KEY_ENTER); lv_event_send(w->getLvObj(), LV_EVENT_LONG_PRESSED, nullptr); } } diff --git a/radio/src/gui/colorlcd/gvar_numberedit.cpp b/radio/src/gui/colorlcd/gvar_numberedit.cpp index 36dab266739..40332147be8 100644 --- a/radio/src/gui/colorlcd/gvar_numberedit.cpp +++ b/radio/src/gui/colorlcd/gvar_numberedit.cpp @@ -119,8 +119,6 @@ void GVarNumberEdit::setSuffix(std::string value) void GVarNumberEdit::onEvent(event_t event) { if (event == EVT_KEY_LONG(KEY_ENTER)) { - // TODO: check this... - // killEvents(event); switchGVarMode(); } else { Window::onEvent(event); diff --git a/radio/src/gui/colorlcd/menu_model.cpp b/radio/src/gui/colorlcd/menu_model.cpp index 6005829c0c8..753b72060e4 100644 --- a/radio/src/gui/colorlcd/menu_model.cpp +++ b/radio/src/gui/colorlcd/menu_model.cpp @@ -77,7 +77,7 @@ void ModelMenu::addGoToMonitorsButton() getHeaderWindow(), {LCD_W / 2 + 6, MENU_TITLE_TOP + 1, LCD_W / 2 - 8, MENU_TITLE_HEIGHT - 2}, STR_OPEN_CHANNEL_MONITORS, [=]() { - pushEvent(EVT_KEY_FIRST(KEY_MODEL)); + pushEvent(EVT_KEY_BREAK(KEY_MODEL)); return 0; }); } diff --git a/radio/src/gui/colorlcd/model_templates.cpp b/radio/src/gui/colorlcd/model_templates.cpp index b3948e6a4fd..0a306b40b6c 100644 --- a/radio/src/gui/colorlcd/model_templates.cpp +++ b/radio/src/gui/colorlcd/model_templates.cpp @@ -83,7 +83,6 @@ void TemplatePage::updateInfo() void TemplatePage::onEvent(event_t event) { if (event == EVT_KEY_LONG(KEY_EXIT) || event == EVT_KEY_BREAK(KEY_EXIT)) { - killEvents(event); deleteLater(); } else { Page::onEvent(event); diff --git a/radio/src/gui/colorlcd/select_fab_carousel.cpp b/radio/src/gui/colorlcd/select_fab_carousel.cpp index aa9d6320020..3cd813f2c2d 100644 --- a/radio/src/gui/colorlcd/select_fab_carousel.cpp +++ b/radio/src/gui/colorlcd/select_fab_carousel.cpp @@ -123,7 +123,6 @@ class SelectFabButton : public ButtonBase #if defined(HARDWARE_KEYS) switch (event) { case EVT_KEY_BREAK(KEY_EXIT): - killEvents(event); parent->deleteLater(); return; } diff --git a/radio/src/gui/common/stdlcd/draw_functions.cpp b/radio/src/gui/common/stdlcd/draw_functions.cpp index d69f58bb8c3..a1a4a0ee6f9 100644 --- a/radio/src/gui/common/stdlcd/draw_functions.cpp +++ b/radio/src/gui/common/stdlcd/draw_functions.cpp @@ -241,7 +241,6 @@ void editName(coord_t x, coord_t y, char* name, uint8_t size, event_t event, #if !defined(NAVIGATION_XLITE) if (v == ' ') { s_editMode = 0; - killEvents(event); break; } else @@ -255,7 +254,6 @@ void editName(coord_t x, coord_t y, char* name, uint8_t size, event_t event, #if defined(NAVIGATION_9X) if (event==EVT_KEY_LONG(KEY_LEFT)) - killEvents(KEY_LEFT); #endif break; } diff --git a/radio/src/gui/common/stdlcd/menus.cpp b/radio/src/gui/common/stdlcd/menus.cpp index c703ee701dd..33d618aa310 100644 --- a/radio/src/gui/common/stdlcd/menus.cpp +++ b/radio/src/gui/common/stdlcd/menus.cpp @@ -55,7 +55,7 @@ void chainMenu(MenuHandlerFunc newMenu) void pushMenu(MenuHandlerFunc newMenu) { - killEvents(KEY_ENTER); + killEvents(KEY_ENTER); // TODO: Check if needed. if (menuLevel == 0) { if (newMenu == menuRadioSetup) diff --git a/radio/src/gui/common/stdlcd/model_inputs.cpp b/radio/src/gui/common/stdlcd/model_inputs.cpp index 1ee25cfdb3f..eddd29da663 100644 --- a/radio/src/gui/common/stdlcd/model_inputs.cpp +++ b/radio/src/gui/common/stdlcd/model_inputs.cpp @@ -262,7 +262,6 @@ void menuModelExposAll(event_t event) case EVT_KEY_LONG(KEY_EXIT): if (s_copyMode && s_copyTgtOfs == 0) { deleteExpo(s_currIdx); - killEvents(event); event = 0; } // no break @@ -297,7 +296,6 @@ void menuModelExposAll(event_t event) } // no break case EVT_KEY_LONG(KEY_ENTER): - killEvents(event); if (s_copyTgtOfs) { s_copyMode = 0; s_copyTgtOfs = 0; @@ -335,7 +333,6 @@ void menuModelExposAll(event_t event) // insertExpo(s_currIdx); // pushMenu(menuModelExpoOne); // s_copyMode = 0; - // killEvents(event); // } // break; } diff --git a/radio/src/gui/common/stdlcd/model_mixes.cpp b/radio/src/gui/common/stdlcd/model_mixes.cpp index 6dbfc88e3df..4d43fef81b7 100644 --- a/radio/src/gui/common/stdlcd/model_mixes.cpp +++ b/radio/src/gui/common/stdlcd/model_mixes.cpp @@ -178,7 +178,6 @@ void menuModelMixAll(event_t event) case EVT_KEY_LONG(KEY_EXIT): if (s_copyMode && s_copyTgtOfs == 0) { deleteMix(s_currIdx); - killEvents(event); event = 0; } // no break @@ -214,7 +213,6 @@ void menuModelMixAll(event_t event) // no break case EVT_KEY_LONG(KEY_ENTER): - killEvents(event); if (s_copyTgtOfs) { s_copyMode = 0; s_copyTgtOfs = 0; @@ -252,7 +250,6 @@ void menuModelMixAll(event_t event) // insertMix(s_currIdx, s_currCh - 1); // pushMenu(menuModelMixOne); // s_copyMode = 0; - // killEvents(event); // } // break; } diff --git a/radio/src/gui/common/stdlcd/model_module_options.cpp b/radio/src/gui/common/stdlcd/model_module_options.cpp index 6274cae3f1b..3ff084ab3db 100644 --- a/radio/src/gui/common/stdlcd/model_module_options.cpp +++ b/radio/src/gui/common/stdlcd/model_module_options.cpp @@ -91,7 +91,7 @@ void menuModelModuleOptions(event_t event) } if (menuEvent) { - killEvents(KEY_EXIT); + killEvents(KEY_EXIT); // TODO: Check if needed moduleState[g_moduleIdx].mode = MODULE_MODE_NORMAL; if (reusableBuffer.hardwareAndSettings.moduleSettings.dirty) { abortPopMenu(); @@ -103,7 +103,6 @@ void menuModelModuleOptions(event_t event) } if (event == EVT_KEY_LONG(KEY_ENTER) && reusableBuffer.hardwareAndSettings.moduleSettings.dirty) { - killEvents(event); reusableBuffer.hardwareAndSettings.moduleSettings.dirty = MODULE_SETTINGS_OK; moduleState[g_moduleIdx].writeModuleSettings(&reusableBuffer.hardwareAndSettings.moduleSettings); } diff --git a/radio/src/gui/common/stdlcd/model_receiver_options.cpp b/radio/src/gui/common/stdlcd/model_receiver_options.cpp index 8b1a06d5951..a1bac4f2e6c 100644 --- a/radio/src/gui/common/stdlcd/model_receiver_options.cpp +++ b/radio/src/gui/common/stdlcd/model_receiver_options.cpp @@ -106,7 +106,7 @@ void menuModelReceiverOptions(event_t event) }); if (menuEvent) { - killEvents(KEY_EXIT); + killEvents(KEY_EXIT); // TODO: Check if needed moduleState[g_moduleIdx].mode = MODULE_MODE_NORMAL; if (reusableBuffer.hardwareAndSettings.receiverSettings.dirty) { abortPopMenu(); @@ -127,7 +127,6 @@ void menuModelReceiverOptions(event_t event) } if (event == EVT_KEY_LONG(KEY_ENTER) && reusableBuffer.hardwareAndSettings.receiverSettings.dirty) { - killEvents(event); reusableBuffer.hardwareAndSettings.receiverSettings.dirty = RECEIVER_SETTINGS_OK; moduleState[g_moduleIdx].writeReceiverSettings(&reusableBuffer.hardwareAndSettings.receiverSettings); } diff --git a/radio/src/gui/common/stdlcd/model_usbjoystick.cpp b/radio/src/gui/common/stdlcd/model_usbjoystick.cpp index b9ee562d85b..a23704fd18a 100644 --- a/radio/src/gui/common/stdlcd/model_usbjoystick.cpp +++ b/radio/src/gui/common/stdlcd/model_usbjoystick.cpp @@ -50,20 +50,14 @@ enum USBJFields { void menuModelUSBJoystickOne(event_t event) { -#if defined(KEYS_GPIO_REG_MDL) - if (event == EVT_KEY_FIRST(KEY_MODEL)) { - pushMenu(menuChannelsView); - killEvents(event); - } -#elif defined(NAVIGATION_X7) - if (event == EVT_KEY_FIRST(KEY_MENU)) { +#if defined(NAVIGATION_XLITE) + if (event == EVT_KEY_FIRST(KEY_ENTER) && keysGetState(KEY_SHIFT)) { pushMenu(menuChannelsView); killEvents(event); } -#elif defined(NAVIGATION_XLITE) - if (event == EVT_KEY_FIRST(KEY_ENTER) && keysGetState(KEY_SHIFT)) { +#else + if (event == EVT_KEY_BREAK(KEY_MODEL) || event == EVT_KEY_BREAK(KEY_MENU)) { pushMenu(menuChannelsView); - killEvents(event); } #endif USBJoystickChData * cch = usbJChAddress(s_currIdx); @@ -198,8 +192,7 @@ void menuModelUSBJoystick(event_t event) coord_t y = 0; uint8_t k = 0; - if (event == EVT_KEY_FIRST(KEY_ENTER)) { - killEvents(event); + if (event == EVT_KEY_BREAK(KEY_ENTER)) { USBJoystickChData * cch = usbJChAddress(sub); s_currIdx = sub; if (sub >= 0) diff --git a/radio/src/gui/common/stdlcd/radio_ghost_menu.cpp b/radio/src/gui/common/stdlcd/radio_ghost_menu.cpp index 2821e86c5b8..92134711495 100644 --- a/radio/src/gui/common/stdlcd/radio_ghost_menu.cpp +++ b/radio/src/gui/common/stdlcd/radio_ghost_menu.cpp @@ -64,7 +64,7 @@ void menuGhostModuleConfig(event_t event) break; - case EVT_KEY_FIRST(KEY_ENTER): + case EVT_KEY_BREAK(KEY_ENTER): reusableBuffer.ghostMenu.buttonAction = GHST_BTN_JOYPRESS; reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_NONE; moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL; diff --git a/radio/src/gui/common/stdlcd/radio_hardware.cpp b/radio/src/gui/common/stdlcd/radio_hardware.cpp index cedb263ce43..52ffc035a78 100644 --- a/radio/src/gui/common/stdlcd/radio_hardware.cpp +++ b/radio/src/gui/common/stdlcd/radio_hardware.cpp @@ -265,7 +265,7 @@ void menuRadioHardware(event_t event) case ITEM_RADIO_HARDWARE_LABEL_STICKS: lcdDrawTextAlignedLeft(y, STR_STICKS); lcdDrawText(HW_SETTINGS_COLUMN2, y, BUTTON(TR_CALIBRATION), attr); - if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) { + if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) { pushMenu(menuRadioCalibration); } break; diff --git a/radio/src/gui/common/stdlcd/radio_power_meter.cpp b/radio/src/gui/common/stdlcd/radio_power_meter.cpp index f493e2aee10..ed5bad56b79 100644 --- a/radio/src/gui/common/stdlcd/radio_power_meter.cpp +++ b/radio/src/gui/common/stdlcd/radio_power_meter.cpp @@ -40,8 +40,7 @@ void menuRadioPowerMeter(event_t event) if (TELEMETRY_STREAMING()) { lcdDrawCenteredText(LCD_H/2, STR_TURN_OFF_RECEIVER); - if (event == EVT_KEY_FIRST(KEY_EXIT)) { - killEvents(event); + if (event == EVT_KEY_BREAK(KEY_EXIT)) { popMenu(); } return; diff --git a/radio/src/gui/common/stdlcd/radio_sdmanager.cpp b/radio/src/gui/common/stdlcd/radio_sdmanager.cpp index 0785bb0a5c0..fc4664e380d 100644 --- a/radio/src/gui/common/stdlcd/radio_sdmanager.cpp +++ b/radio/src/gui/common/stdlcd/radio_sdmanager.cpp @@ -307,7 +307,6 @@ void menuRadioSdManager(event_t _event) #if defined(KEYS_GPIO_REG_MENU) case EVT_KEY_LONG(KEY_MENU): if (SD_CARD_PRESENT() && !READ_ONLY() && s_editMode == 0) { - killEvents(_event); POPUP_MENU_ADD_ITEM(STR_SD_INFO); POPUP_MENU_START(onSdManagerMenu); } @@ -332,7 +331,6 @@ void menuRadioSdManager(event_t _event) menuVerticalOffset = 0; menuVerticalPosition = HEADER_LINE; REFRESH_FILES(); - killEvents(_event); return; } } @@ -341,7 +339,6 @@ void menuRadioSdManager(event_t _event) case EVT_KEY_LONG(KEY_ENTER): #if (HEADER_LINE > 0) if (menuVerticalPosition < HEADER_LINE) { - killEvents(_event); POPUP_MENU_ADD_ITEM(STR_SD_INFO); POPUP_MENU_START(onSdManagerMenu); break; @@ -351,7 +348,6 @@ void menuRadioSdManager(event_t _event) getSelectionFullPath(lfn); if (SD_CARD_PRESENT() && s_editMode <= 0) { - killEvents(_event); int index = menuVerticalPosition - HEADER_LINE - menuVerticalOffset; char * line = reusableBuffer.sdManager.lines[index]; if (!strcmp(line, "..")) { diff --git a/radio/src/gui/common/stdlcd/radio_spectrum_analyser.cpp b/radio/src/gui/common/stdlcd/radio_spectrum_analyser.cpp index 451f44cc1f3..dc8d2e75506 100644 --- a/radio/src/gui/common/stdlcd/radio_spectrum_analyser.cpp +++ b/radio/src/gui/common/stdlcd/radio_spectrum_analyser.cpp @@ -56,8 +56,7 @@ void menuRadioSpectrumAnalyser(event_t event) if (moduleState[g_moduleIdx].mode != MODULE_MODE_SPECTRUM_ANALYSER) { if (TELEMETRY_STREAMING()) { lcdDrawCenteredText(LCD_H/2, STR_TURN_OFF_RECEIVER); - if (event == EVT_KEY_FIRST(KEY_EXIT)) { - killEvents(event); + if (event == EVT_KEY_BREAK(KEY_EXIT)) { popMenu(); } return; diff --git a/radio/src/gui/common/stdlcd/view_telemetry.cpp b/radio/src/gui/common/stdlcd/view_telemetry.cpp index 4f3c55b1b9b..65c643a2116 100644 --- a/radio/src/gui/common/stdlcd/view_telemetry.cpp +++ b/radio/src/gui/common/stdlcd/view_telemetry.cpp @@ -39,8 +39,8 @@ enum NavigationDirection { #define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_FIRST(KEY_PAGEUP)) #define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_FIRST(KEY_PAGEDN)) #elif defined(NAVIGATION_X7) || defined(NAVIGATION_X9D) - #define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_PAGE)) - #define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_BREAK(KEY_PAGE)) + #define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_BREAK(KEY_PAGEUP)) + #define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_BREAK(KEY_PAGEDN)) #elif defined(NAVIGATION_9X) #define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_UP)) #define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_LONG(KEY_DOWN)) @@ -53,26 +53,21 @@ void menuViewTelemetry(event_t event) { enum NavigationDirection direction = NAVIGATION_DIRECTION_NONE; - if (event == EVT_KEY_FIRST(KEY_EXIT) && TELEMETRY_SCREEN_TYPE(s_frsky_view) != TELEMETRY_SCREEN_TYPE_SCRIPT) { - killEvents(event); + if (event == EVT_KEY_BREAK(KEY_EXIT) && TELEMETRY_SCREEN_TYPE(s_frsky_view) != TELEMETRY_SCREEN_TYPE_SCRIPT) { chainMenu(menuMainView); } #if defined(LUA) else if (event == EVT_KEY_LONG(KEY_EXIT)) { - killEvents(event); chainMenu(menuMainView); } #endif else if (EVT_KEY_PREVIOUS_VIEW(event)) { - killEvents(event); decrTelemetryScreen(); } else if (EVT_KEY_NEXT_VIEW(event)) { - killEvents(event); incrTelemetryScreen(); } else if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); POPUP_MENU_START(onMainViewMenu, 2, STR_RESET_TELEMETRY, STR_RESET_FLIGHT); } diff --git a/radio/src/gui/navigation/navigation_9x.cpp b/radio/src/gui/navigation/navigation_9x.cpp index 11c07ef1f32..3ebc1dba5fc 100644 --- a/radio/src/gui/navigation/navigation_9x.cpp +++ b/radio/src/gui/navigation/navigation_9x.cpp @@ -228,7 +228,7 @@ void check(event_t event, uint8_t curr, const MenuHandler *menuTab, s_editMode = EDIT_MODE_INIT; break; - case EVT_KEY_FIRST(KEY_ENTER): + case EVT_KEY_BREAK(KEY_ENTER): if (!menuTab || l_posVert>0) { if (READ_ONLY_UNLOCKED()) { s_editMode = (s_editMode <= 0); diff --git a/radio/src/gui/navigation/navigation_x7.cpp b/radio/src/gui/navigation/navigation_x7.cpp index 6e21792fb8e..09e7f7139ce 100644 --- a/radio/src/gui/navigation/navigation_x7.cpp +++ b/radio/src/gui/navigation/navigation_x7.cpp @@ -141,7 +141,6 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, if (i_flags & INCDEC_SOURCE) { if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); checkIncDecSelection = MIXSRC_NONE; if (i_min <= MIXSRC_FIRST_INPUT && i_max >= MIXSRC_FIRST_INPUT) { @@ -194,7 +193,6 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, } else if (i_flags & INCDEC_SWITCH) { if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); checkIncDecSelection = SWSRC_NONE; if (i_min <= SWSRC_FIRST_SWITCH && i_max >= SWSRC_LAST_SWITCH) POPUP_MENU_ADD_ITEM(STR_MENU_SWITCHES); if (i_min <= SWSRC_FIRST_TRIM && i_max >= SWSRC_LAST_TRIM) POPUP_MENU_ADD_ITEM(STR_MENU_TRIMS); @@ -286,23 +284,14 @@ void check(event_t event, uint8_t curr, const MenuHandler *menuTab, if (menuTab) { int cc = curr; switch (event) { -#if defined(KEYS_GPIO_REG_PAGEUP) - case EVT_KEY_FIRST(KEY_PAGEUP): -#else - case EVT_KEY_LONG(KEY_PAGE): -#endif + case EVT_KEY_BREAK(KEY_PAGEUP): if (s_editMode>0) break; cc = chgMenu(curr, menuTab, menuTabSize, -1); - killEvents(event); break; -#if defined(KEYS_GPIO_REG_PAGEDN) - case EVT_KEY_FIRST(KEY_PAGEDN): -#else - case EVT_KEY_BREAK(KEY_PAGE): -#endif + case EVT_KEY_BREAK(KEY_PAGEDN): if (s_editMode>0) break; diff --git a/radio/src/gui/navigation/navigation_x9d.cpp b/radio/src/gui/navigation/navigation_x9d.cpp index b077ddf3fa2..a005f78106e 100644 --- a/radio/src/gui/navigation/navigation_x9d.cpp +++ b/radio/src/gui/navigation/navigation_x9d.cpp @@ -141,7 +141,6 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, if (i_flags & INCDEC_SOURCE) { if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); checkIncDecSelection = MIXSRC_NONE; if (i_min <= MIXSRC_FIRST_INPUT && i_max >= MIXSRC_FIRST_INPUT) { @@ -194,7 +193,6 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, } else if (i_flags & INCDEC_SWITCH) { if (event == EVT_KEY_LONG(KEY_ENTER)) { - killEvents(event); checkIncDecSelection = SWSRC_NONE; if (i_min <= SWSRC_FIRST_SWITCH && i_max >= SWSRC_LAST_SWITCH) POPUP_MENU_ADD_ITEM(STR_MENU_SWITCHES); if (i_min <= SWSRC_FIRST_TRIM && i_max >= SWSRC_LAST_TRIM) POPUP_MENU_ADD_ITEM(STR_MENU_TRIMS); @@ -329,7 +327,6 @@ void check(event_t event, uint8_t curr, const MenuHandler *menuTab, switch (event) { case EVT_KEY_LONG(KEY_MENU): if (menuTab == menuTabModel) { - killEvents(event); if (modelHasNotes()) { POPUP_MENU_ADD_SD_ITEM(STR_VIEW_CHANNELS); POPUP_MENU_ADD_ITEM(STR_VIEW_NOTES); @@ -341,15 +338,14 @@ void check(event_t event, uint8_t curr, const MenuHandler *menuTab, } break; - case EVT_KEY_LONG(KEY_PAGE): + case EVT_KEY_BREAK(KEY_PAGEUP): if (s_editMode>0) break; cc = chgMenu(curr, menuTab, menuTabSize, -1); - killEvents(event); break; - case EVT_KEY_BREAK(KEY_PAGE): + case EVT_KEY_BREAK(KEY_PAGEDN): if (s_editMode>0) break; diff --git a/radio/src/gui/navigation/navigation_xlite.cpp b/radio/src/gui/navigation/navigation_xlite.cpp index ffaeb43ba13..ce3f737dc35 100644 --- a/radio/src/gui/navigation/navigation_xlite.cpp +++ b/radio/src/gui/navigation/navigation_xlite.cpp @@ -150,7 +150,6 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, if (i_flags & INCDEC_SOURCE) { if (event == EVT_KEY_LONG(KEY_ENTER) && !keysGetState(KEY_SHIFT)) { - killEvents(event); checkIncDecSelection = MIXSRC_NONE; if (i_min <= MIXSRC_FIRST_INPUT && i_max >= MIXSRC_FIRST_INPUT) { @@ -203,7 +202,6 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, } else if (i_flags & INCDEC_SWITCH) { if (event == EVT_KEY_LONG(KEY_ENTER) && !keysGetState(KEY_SHIFT)) { - killEvents(event); checkIncDecSelection = SWSRC_NONE; if (i_min <= SWSRC_FIRST_SWITCH && i_max >= SWSRC_LAST_SWITCH) POPUP_MENU_ADD_ITEM(STR_MENU_SWITCHES); if (i_min <= SWSRC_FIRST_TRIM && i_max >= SWSRC_LAST_TRIM) POPUP_MENU_ADD_ITEM(STR_MENU_TRIMS); diff --git a/radio/src/hal/key_driver.h b/radio/src/hal/key_driver.h index 1701071a621..d960e232443 100644 --- a/radio/src/hal/key_driver.h +++ b/radio/src/hal/key_driver.h @@ -28,7 +28,6 @@ enum EnumKeys { KEY_EXIT, KEY_ENTER, - KEY_PAGE, KEY_PAGEUP, KEY_PAGEDN, diff --git a/radio/src/keys.cpp b/radio/src/keys.cpp index 77cd9a13a4a..b1f8a2f263d 100644 --- a/radio/src/keys.cpp +++ b/radio/src/keys.cpp @@ -58,7 +58,9 @@ #define KSTATE_RPTDELAY 95 #define KSTATE_START 97 #define KSTATE_PAUSE 98 -#define KSTATE_KILLED 99 + +#define KFLAG_KILLED 1 +#define KFLAG_LONG_PRESS 2 // global last event event_t s_evt; @@ -72,6 +74,7 @@ class Key uint8_t m_vals = 0; uint8_t m_cnt = 0; uint8_t m_state = 0; + uint8_t m_flags = 0; public: event_t input(bool val); @@ -92,16 +95,19 @@ event_t Key::input(bool val) m_cnt++; - if (m_state && m_vals == 0) { + if ((m_state || m_flags) && m_vals == 0) { // key is released - if (m_state != KSTATE_KILLED) { + if ((m_flags & (KFLAG_KILLED|KFLAG_LONG_PRESS)) == 0) { evt = _MSK_KEY_BREAK; } m_state = KSTATE_OFF; m_cnt = 0; + m_flags = 0; return evt; } + if (m_flags & KFLAG_KILLED) return evt; + switch (m_state) { case KSTATE_OFF: if (m_vals == FILTER_MASK) { @@ -121,6 +127,7 @@ event_t Key::input(bool val) if (m_cnt == KEY_LONG_DELAY) { // generate long key press evt = _MSK_KEY_LONG; + m_flags |= KFLAG_LONG_PRESS; } if (m_cnt == KEY_REPEAT_DELAY) { m_state = 16; @@ -150,9 +157,6 @@ event_t Key::input(bool val) m_cnt = 0; } break; - - case KSTATE_KILLED: //killed - break; } return evt; @@ -166,8 +170,8 @@ void Key::pauseEvents() void Key::killEvents() { - // TRACE("key %d killed", key()); - m_state = KSTATE_KILLED; + if (m_state) + m_flags |= KFLAG_KILLED; } static Key keys[MAX_KEYS]; @@ -427,10 +431,22 @@ bool keysPollingCycle() for (int i = 0; i < MAX_KEYS; i++) { event_t evt = keys[i].input(keys_input & (1 << i)); if (evt) { + evt |= i; +#if defined(KEYS_GPIO_REG_PAGEDN) && !defined(KEYS_GPIO_REG_PAGEUP) + // Radio with single PAGEDN key + if (evt == EVT_KEY_LONG(KEY_PAGEDN)) { + // Convert long press PAGEDN to short press PAGEUP + evt = EVT_KEY_BREAK(KEY_PAGEUP); + } +#endif +#if defined(KEYS_GPIO_REG_SHIFT) // SHIFT key should not trigger REPT events - if (i != KEY_SHIFT || evt != _MSK_KEY_REPT) { - pushEvent(evt | i); + if (evt != EVT_KEY_REPT(KEY_SHIFT)) { + pushEvent(evt); } +#else + pushEvent(evt); +#endif } } diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index 5c549a9c3c2..a13c62a30e7 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -1657,11 +1657,11 @@ Stops key state machine. See [Key Events](../key_events.md) for the detailed des */ static int luaKillEvents(lua_State * L) { -#if defined(KEYS_GPIO_REG_PAGE) +#if defined(KEYS_GPIO_REG_MENU) #define IS_MASKABLE(key) \ ((key) != KEY_EXIT && (key) != KEY_ENTER && \ ((scriptInternalData[0].reference == SCRIPT_STANDALONE) || \ - (key) != KEY_PAGE)) + (key) != KEY_PAGEDN)) #else #define IS_MASKABLE(key) ((key) != KEY_EXIT && (key) != KEY_ENTER) #endif diff --git a/radio/src/lua/interface.cpp b/radio/src/lua/interface.cpp index b7fd71b16ed..007792d8e6e 100644 --- a/radio/src/lua/interface.cpp +++ b/radio/src/lua/interface.cpp @@ -1191,7 +1191,6 @@ static bool resumeLua(bool init, bool allowLcdUsage) if (scriptResult != 0) { TRACE("Script finished with status %d", scriptResult); - killAllEvents(); luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS; } else if (luaDisplayStatistics) { @@ -1221,14 +1220,12 @@ static bool resumeLua(bool init, bool allowLcdUsage) if (evt.event == EVT_KEY_LONG(KEY_EXIT)) { TRACE("Script force exit"); - // killEvents(evt); luaEmptyEventBuffer(); luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS; } #if defined(KEYS_GPIO_REG_MENU) // TODO find another key and add a #define else if (evt.event == EVT_KEY_LONG(KEY_MENU)) { - killEvents(evt.event); luaEmptyEventBuffer(); luaDisplayStatistics = !luaDisplayStatistics; } diff --git a/radio/src/lua/lua_widget.cpp b/radio/src/lua/lua_widget.cpp index 3d74599f5c2..f1e62578177 100644 --- a/radio/src/lua/lua_widget.cpp +++ b/radio/src/lua/lua_widget.cpp @@ -166,14 +166,6 @@ void LuaEventHandler::onCancel() { luaPushEvent(EVT_KEY_BREAK(KEY_EXIT)); } void LuaEventHandler::onEvent(event_t event) { - if (event == EVT_KEY_LONG(KEY_EXIT)) { - killEvents(KEY_EXIT); - } -#if !defined(KEYS_GPIO_REG_PAGEUP) && !defined(USE_HATS_AS_KEYS) - else if (event == EVT_KEY_LONG(KEY_PAGEDN)) { - killEvents(KEY_PAGEDN); - } -#endif luaPushEvent(event); } diff --git a/radio/src/main.cpp b/radio/src/main.cpp index aae6b431f29..9e4be7b04a9 100644 --- a/radio/src/main.cpp +++ b/radio/src/main.cpp @@ -440,13 +440,6 @@ bool handleGui(event_t event) TELEMETRY_SCREEN_TYPE(s_frsky_view) == TELEMETRY_SCREEN_TYPE_SCRIPT; bool isStandalone = scriptInternalData[0].reference == SCRIPT_STANDALONE; if ((isTelemView || isStandalone) && event) { -#if !defined(KEYS_GPIO_REG_PAGEUP) - // For radios with a single PAGE key, kill the - // EVT_KEY_BREAK event after a long press of the PAGE key. - if (event == EVT_KEY_LONG(KEY_PAGE)) { - killEvents(KEY_PAGE); - } -#endif luaPushEvent(event); } refreshNeeded = luaTask(true); diff --git a/radio/src/simu.cpp b/radio/src/simu.cpp index e06ab5936ed..367a0a14471 100644 --- a/radio/src/simu.cpp +++ b/radio/src/simu.cpp @@ -389,9 +389,7 @@ void OpenTxSim::updateKeysAndSwitches(bool start) KEY_Down, KEY_MINUS, #elif defined(PCBTARANIS) KEY_Page_Up, KEY_MENU, - #if defined(KEYS_GPIO_REG_PAGE) - KEY_Page_Down, KEY_PAGE, - #endif + KEY_Page_Down, KEY_PAGEDN, KEY_Return, KEY_ENTER, KEY_BackSpace, KEY_EXIT, KEY_Up, KEY_PLUS, diff --git a/radio/src/targets/taranis/hal.h b/radio/src/targets/taranis/hal.h index 0cde06a1adc..ed6417ebe36 100644 --- a/radio/src/targets/taranis/hal.h +++ b/radio/src/targets/taranis/hal.h @@ -50,8 +50,8 @@ #define KEYS_GPIO_PIN_MENU LL_GPIO_PIN_7 // PD.07 #define KEYS_GPIO_REG_EXIT GPIOD #define KEYS_GPIO_PIN_EXIT LL_GPIO_PIN_2 // PD.02 - #define KEYS_GPIO_REG_PAGE GPIOD - #define KEYS_GPIO_PIN_PAGE LL_GPIO_PIN_3 // PD.03 + #define KEYS_GPIO_REG_PAGEDN GPIOD + #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_3 // PD.03 #define KEYS_GPIO_REG_ENTER GPIOF #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_0 // PF.00 #elif defined(PCBXLITE) @@ -153,8 +153,8 @@ #define KEYS_GPIO_REG_BIND GPIOD #define KEYS_GPIO_PIN_BIND LL_GPIO_PIN_9 // PD.09 #elif defined(RADIO_FAMILY_T20) - #define KEYS_GPIO_REG_PAGE GPIOD - #define KEYS_GPIO_PIN_PAGE LL_GPIO_PIN_11 // PD.11 + #define KEYS_GPIO_REG_PAGEDN GPIOD + #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_11 // PD.11 #define KEYS_GPIO_REG_MENU GPIOD #define KEYS_GPIO_PIN_MENU LL_GPIO_PIN_10 // PD.10 #define KEYS_GPIO_REG_EXIT GPIOD @@ -162,8 +162,8 @@ #define KEYS_GPIO_REG_ENTER GPIOE #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_7 // PE.7 #elif defined(RADIO_T14) - #define KEYS_GPIO_REG_PAGE GPIOD - #define KEYS_GPIO_PIN_PAGE LL_GPIO_PIN_3 // PD.03 + #define KEYS_GPIO_REG_PAGEDN GPIOD + #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_3 // PD.03 #define KEYS_GPIO_REG_MENU GPIOD #define KEYS_GPIO_PIN_MENU LL_GPIO_PIN_7 // PD.07 #define KEYS_GPIO_REG_EXIT GPIOD @@ -171,8 +171,8 @@ #define KEYS_GPIO_REG_ENTER GPIOA #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_13 // PA.13 #elif defined(PCBX7) - #define KEYS_GPIO_REG_PAGE GPIOD - #define KEYS_GPIO_PIN_PAGE LL_GPIO_PIN_3 // PD.03 + #define KEYS_GPIO_REG_PAGEDN GPIOD + #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_3 // PD.03 #define KEYS_GPIO_REG_MENU GPIOD #define KEYS_GPIO_PIN_MENU LL_GPIO_PIN_7 // PD.07 #define KEYS_GPIO_REG_EXIT GPIOD @@ -180,8 +180,8 @@ #define KEYS_GPIO_REG_ENTER GPIOE #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_10 // PE.10 #elif defined(PCBX9LITE) - #define KEYS_GPIO_REG_PAGE GPIOE - #define KEYS_GPIO_PIN_PAGE LL_GPIO_PIN_8 // PE.08 + #define KEYS_GPIO_REG_PAGEDN GPIOE + #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_8 // PE.08 #define KEYS_GPIO_REG_MENU GPIOE #define KEYS_GPIO_PIN_MENU LL_GPIO_PIN_7 // PE.07 #define KEYS_GPIO_REG_EXIT GPIOE @@ -193,8 +193,8 @@ #define KEYS_GPIO_PIN_MENU LL_GPIO_PIN_2 // PD.02 #define KEYS_GPIO_REG_EXIT GPIOD #define KEYS_GPIO_PIN_EXIT LL_GPIO_PIN_7 // PD.07 - #define KEYS_GPIO_REG_PAGE GPIOD - #define KEYS_GPIO_PIN_PAGE LL_GPIO_PIN_3 // PD.03 + #define KEYS_GPIO_REG_PAGEDN GPIOD + #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_3 // PD.03 #define KEYS_GPIO_REG_ENTER GPIOE #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_12 // PE.12 #else @@ -202,8 +202,8 @@ #define KEYS_GPIO_PIN_MENU LL_GPIO_PIN_7 // PD.07 #define KEYS_GPIO_REG_EXIT GPIOD #define KEYS_GPIO_PIN_EXIT LL_GPIO_PIN_2 // PD.02 - #define KEYS_GPIO_REG_PAGE GPIOD - #define KEYS_GPIO_PIN_PAGE LL_GPIO_PIN_3 // PD.03 + #define KEYS_GPIO_REG_PAGEDN GPIOD + #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_3 // PD.03 #define KEYS_GPIO_REG_PLUS GPIOE #define KEYS_GPIO_PIN_PLUS LL_GPIO_PIN_10 // PE.10 #define KEYS_GPIO_REG_MINUS GPIOE diff --git a/radio/src/thirdparty/libopenui/src/menu.cpp b/radio/src/thirdparty/libopenui/src/menu.cpp index ea9762d987c..6790b3bfa24 100644 --- a/radio/src/thirdparty/libopenui/src/menu.cpp +++ b/radio/src/thirdparty/libopenui/src/menu.cpp @@ -439,12 +439,7 @@ void Menu::onEvent(event_t event) { #if defined(HARDWARE_KEYS) if (toolbar && (event == EVT_KEY_BREAK(KEY_PAGEDN) || -#if defined(KEYS_GPIO_REG_PAGEUP) - event == EVT_KEY_BREAK(KEY_PAGEUP) -#else - event == EVT_KEY_LONG(KEY_PAGEDN) -#endif - )) { + event == EVT_KEY_BREAK(KEY_PAGEUP))) { toolbar->onEvent(event); } #endif diff --git a/radio/src/thirdparty/libopenui/src/menutoolbar.cpp b/radio/src/thirdparty/libopenui/src/menutoolbar.cpp index 508d90f4b54..3ef4e1b715f 100644 --- a/radio/src/thirdparty/libopenui/src/menutoolbar.cpp +++ b/radio/src/thirdparty/libopenui/src/menutoolbar.cpp @@ -98,12 +98,7 @@ void MenuToolbar::onEvent(event_t event) if (event == EVT_KEY_BREAK(KEY_PAGEDN)) { lv_group_focus_next(group); } -#if defined(KEYS_GPIO_REG_PAGEUP) else if (event == EVT_KEY_BREAK(KEY_PAGEUP)) { -#else - else if (event == EVT_KEY_LONG(KEY_PAGEDN)) { - killEvents(event); -#endif lv_group_focus_prev(group); } diff --git a/radio/src/thirdparty/libopenui/src/window.cpp b/radio/src/thirdparty/libopenui/src/window.cpp index b3ae5c53f23..95ab645948c 100644 --- a/radio/src/thirdparty/libopenui/src/window.cpp +++ b/radio/src/thirdparty/libopenui/src/window.cpp @@ -400,7 +400,6 @@ void NavWindow::onEvent(event_t event) break; case EVT_KEY_LONG(KEY_MODEL): - killEvents(KEY_MODEL); onLongPressMDL(); break; @@ -409,7 +408,6 @@ void NavWindow::onEvent(event_t event) break; case EVT_KEY_LONG(KEY_SYS): - killEvents(event); onLongPressSYS(); break; @@ -418,7 +416,6 @@ void NavWindow::onEvent(event_t event) break; case EVT_KEY_LONG(KEY_TELE): - killEvents(event); onLongPressTELE(); break; @@ -426,28 +423,9 @@ void NavWindow::onEvent(event_t event) onPressPGDN(); break; -#if defined(KEYS_GPIO_REG_PAGEUP) || defined(USE_HATS_AS_KEYS) - // Radios with both PGUP and PGDN buttons case EVT_KEY_BREAK(KEY_PAGEUP): onPressPGUP(); break; - - case EVT_KEY_LONG(KEY_PAGEDN): - killEvents(event); - onLongPressPGDN(); - break; - - case EVT_KEY_LONG(KEY_PAGEUP): - killEvents(event); - onLongPressPGUP(); - break; -#else - // Radios witb only a single PGUP/DN button - case EVT_KEY_LONG(KEY_PAGEDN): - killEvents(event); - onPressPGUP(); - break; -#endif #endif default: diff --git a/radio/util/hw_defs/generator.py b/radio/util/hw_defs/generator.py index 4129fa79915..616ed5302c9 100644 --- a/radio/util/hw_defs/generator.py +++ b/radio/util/hw_defs/generator.py @@ -22,7 +22,6 @@ "KEY_EXIT", "KEY_ENTER", - "KEY_PAGE", "KEY_PAGEUP", "KEY_PAGEDN", diff --git a/radio/util/hw_defs/hal_keys.py b/radio/util/hw_defs/hal_keys.py index 51b80cfb7e1..0857d099422 100644 --- a/radio/util/hw_defs/hal_keys.py +++ b/radio/util/hw_defs/hal_keys.py @@ -37,7 +37,6 @@ { "name": "EXIT", "key": "KEY_EXIT", "label": "Exit" }, { "name": "ENTER", "key": "KEY_ENTER", "label": "Enter" }, - { "name": "PAGE", "key": "KEY_PAGE", "label": "Page" }, { "name": "PAGEUP", "key": "KEY_PAGEUP", "label": "PgUp" }, { "name": "PAGEDN", "key": "KEY_PAGEDN", "label": "PgDn" }, diff --git a/radio/util/hw_defs/lua_keys.jinja b/radio/util/hw_defs/lua_keys.jinja index 8259930997f..efe153fb3b8 100644 --- a/radio/util/hw_defs/lua_keys.jinja +++ b/radio/util/hw_defs/lua_keys.jinja @@ -6,13 +6,13 @@ {% set key_plus = keys | selectattr("key","==","KEY_PLUS") | first %} {% set key_up = keys | selectattr("key","==","KEY_UP") | first %} {% set key_shift = keys | selectattr("key","==","KEY_SHIFT") | first %} -{% set key_page = keys | selectattr("key","==","KEY_PAGE") | first %} {% set key_pageup = keys | selectattr("key","==","KEY_PAGEUP") | first %} {% set key_pagedn = keys | selectattr("key","==","KEY_PAGEDN") | first %} {% set key_model = keys | selectattr("key","==","KEY_MODEL") | first %} {% set key_menu = keys | selectattr("key","==","KEY_MENU") | first %} {% set key_tele = keys | selectattr("key","==","KEY_TELE") | first %} {% set key_sys = keys | selectattr("key","==","KEY_SYS") | first %} +{% set key_hats_as_keys = not key_pagedn and not key_menu and not key_up %} {% if key_plus %} LROT_NUMENTRY( EVT_VIRTUAL_PREV, EVT_KEY_FIRST(KEY_PLUS) ) @@ -53,18 +53,10 @@ LROT_NUMENTRY( EVT_VIRTUAL_MENU, EVT_KEY_BREAK(KEY_RIGHT) ) LROT_NUMENTRY( EVT_VIRTUAL_MENU_LONG, EVT_KEY_LONG(KEY_RIGHT) ) {% else %} - {% if key_page %} - LROT_NUMENTRY( EVT_VIRTUAL_PREV_PAGE, EVT_KEY_LONG(KEY_PAGE) ) - LROT_NUMENTRY( EVT_VIRTUAL_NEXT_PAGE, EVT_KEY_BREAK(KEY_PAGE) ) - {% elif key_pageup %} LROT_NUMENTRY( EVT_VIRTUAL_PREV_PAGE, EVT_KEY_BREAK(KEY_PAGEUP) ) LROT_NUMENTRY( EVT_VIRTUAL_NEXT_PAGE, EVT_KEY_BREAK(KEY_PAGEDN) ) - {% else %} - LROT_NUMENTRY( EVT_VIRTUAL_PREV_PAGE, EVT_KEY_LONG(KEY_PAGEDN) ) - LROT_NUMENTRY( EVT_VIRTUAL_NEXT_PAGE, EVT_KEY_BREAK(KEY_PAGEDN) ) - {% endif %} - {% if key_model %} + {% if key_model or key_hats_as_keys %} LROT_NUMENTRY( EVT_VIRTUAL_MENU, EVT_KEY_BREAK(KEY_MODEL) ) LROT_NUMENTRY( EVT_VIRTUAL_MENU_LONG, EVT_KEY_LONG(KEY_MODEL) ) {% else %} @@ -92,15 +84,15 @@ LROT_NUMENTRY( EVT_EXIT_BREAK, EVT_KEY_BREAK(KEY_EXIT) ) {{ key_event('MENU','KEY_MENU') }} {% endif %} -{% if key_tele %} +{% if key_tele or key_hats_as_keys %} {{ key_event('TELEM','KEY_TELE') }} {% endif %} -{% if key_model %} +{% if key_model or key_hats_as_keys %} {{ key_event('MODEL','KEY_MODEL') }} {% endif %} -{% if key_sys %} +{% if key_sys or key_hats_as_keys %} {{ key_event('SYS','KEY_SYS') }} {% endif %} @@ -111,16 +103,21 @@ LROT_NUMENTRY( EVT_EXIT_BREAK, EVT_KEY_BREAK(KEY_EXIT) ) {{ key_event('RIGHT', 'KEY_RIGHT') }} {% endif %} -{% if key_page %} - {{ key_event('PAGE', 'KEY_PAGE') }} -{% endif %} - -{% if key_pageup %} +{% if key_pageup or key_hats_as_keys %} {{ key_event('PAGEUP', 'KEY_PAGEUP') }} -{% endif %} - -{% if key_pagedn %} {{ key_event('PAGEDN', 'KEY_PAGEDN') }} +{% elif key_pagedn %} + {% if key_menu %} + LROT_NUMENTRY( EVT_PAGE_FIRST, EVT_KEY_FIRST(KEY_PAGEDN) ) + LROT_NUMENTRY( EVT_PAGE_BREAK, EVT_KEY_BREAK(KEY_PAGEDN) ) + LROT_NUMENTRY( EVT_PAGE_LONG, EVT_KEY_BREAK(KEY_PAGEUP) ) + LROT_NUMENTRY( EVT_PAGE_REPT, EVT_KEY_REPT(KEY_PAGEDN) ) + {% else %} + LROT_NUMENTRY( EVT_PAGEDN_FIRST, EVT_KEY_FIRST(KEY_PAGEDN) ) + LROT_NUMENTRY( EVT_PAGEDN_BREAK, EVT_KEY_BREAK(KEY_PAGEDN) ) + LROT_NUMENTRY( EVT_PAGEDN_LONG, EVT_KEY_BREAK(KEY_PAGEUP) ) + LROT_NUMENTRY( EVT_PAGEDN_REPT, EVT_KEY_REPT(KEY_PAGEDN) ) + {% endif %} {% endif %} {% if key_plus %}