Skip to content

Commit 522474c

Browse files
authored
feat(color): allow long press of PAGE keys to navigate menus (#6109)
1 parent a22c2ec commit 522474c

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

radio/src/gui/colorlcd/libui/tabsgroup.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ void TabsGroup::checkEvents()
363363
#if defined(HARDWARE_KEYS)
364364
void TabsGroup::onPressPGUP() { header->prevTab(); }
365365
void TabsGroup::onPressPGDN() { header->nextTab(); }
366+
void TabsGroup::onLongPressPGUP() { header->prevTab(); }
367+
void TabsGroup::onLongPressPGDN() { header->nextTab(); }
366368
void TabsGroup::onLongPressRTN() { onCancel(); }
367369
#endif
368370

radio/src/gui/colorlcd/libui/tabsgroup.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class TabsGroup : public NavWindow
100100
#if defined(HARDWARE_KEYS)
101101
void onPressPGUP() override;
102102
void onPressPGDN() override;
103+
void onLongPressPGUP() override;
104+
void onLongPressPGDN() override;
103105
void onLongPressRTN() override;
104106
#endif
105107
};

radio/src/gui/colorlcd/libui/window.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,14 @@ void NavWindow::onEvent(event_t event)
446446
onPressPGUP();
447447
break;
448448

449+
case EVT_KEY_LONG(KEY_PAGEDN):
450+
onLongPressPGDN();
451+
break;
452+
453+
case EVT_KEY_LONG(KEY_PAGEUP):
454+
onLongPressPGUP();
455+
break;
456+
449457
case EVT_KEY_LONG(KEY_EXIT):
450458
onLongPressRTN();
451459
break;

0 commit comments

Comments
 (0)