added has meck fonts build flag to draft max platformio; new fast scroll implementation update with next page scroll function with shift+w/s; updated home page hint text to make it clearer you can press enter to toggle on/off/send adverts etc

This commit is contained in:
pelgraine
2026-05-02 10:07:49 +10:00
parent ca16af54cc
commit 9c4c374db8
9 changed files with 142 additions and 16 deletions
+34
View File
@@ -4567,6 +4567,23 @@ void handleKeyboardInput() {
ui_task.gotoNotesScreen();
break;
case 'S':
// Shift+S: page scroll down on list screens
if (ui_task.isOnChannelScreen() || ui_task.isOnContactsScreen() || ui_task.isOnRepeaterAdmin()
|| ui_task.isOnDiscoveryScreen() || ui_task.isOnLastHeardScreen()
|| ui_task.isOnPathEditor() || ui_task.isOnChannelPickerScreen()
#ifdef MECK_WEB_READER
|| ui_task.isOnWebReader()
#endif
|| ui_task.isOnMapScreen()
#ifdef MECK_AUDIO_VARIANT
|| ui_task.isOnAlarmScreen()
#endif
) {
ui_task.injectKey('S');
}
break;
case 's':
// Open settings (from home), or navigate down on channel/contacts/admin/web/map/discovery/lastheard
if (ui_task.isOnChannelScreen() || ui_task.isOnContactsScreen() || ui_task.isOnRepeaterAdmin()
@@ -4587,6 +4604,23 @@ void handleKeyboardInput() {
}
break;
case 'W':
// Shift+W: page scroll up on list screens
if (ui_task.isOnChannelScreen() || ui_task.isOnContactsScreen() || ui_task.isOnRepeaterAdmin()
|| ui_task.isOnDiscoveryScreen() || ui_task.isOnLastHeardScreen()
|| ui_task.isOnPathEditor() || ui_task.isOnChannelPickerScreen()
#ifdef MECK_WEB_READER
|| ui_task.isOnWebReader()
#endif
|| ui_task.isOnMapScreen()
#ifdef MECK_AUDIO_VARIANT
|| ui_task.isOnAlarmScreen()
#endif
) {
ui_task.injectKey('W');
}
break;
case 'w':
// Navigate up/previous (scroll on channel screen)
if (ui_task.isOnChannelScreen() || ui_task.isOnContactsScreen() || ui_task.isOnRepeaterAdmin()
@@ -495,16 +495,30 @@ public:
}
bool handleInput(char c) override {
// Shift+W: page up
if (c == 'W') {
int pageSize = (128 - 14 - 14) / the_mesh.getNodePrefs()->smallLineH();
if (pageSize < 3) pageSize = 3;
_scrollPos = max(0, _scrollPos - pageSize);
return true;
}
// W - scroll up (previous contact)
if (c == 'w' || c == 'W' || c == 0xF2) {
if (c == 'w' || c == 0xF2) {
if (_scrollPos > 0) {
_scrollPos--;
return true;
}
}
// Shift+S: page down
if (c == 'S') {
int pageSize = (128 - 14 - 14) / the_mesh.getNodePrefs()->smallLineH();
if (pageSize < 3) pageSize = 3;
_scrollPos = min(_filteredCount - 1, _scrollPos + pageSize);
return true;
}
// S - scroll down (next contact)
if (c == 's' || c == 'S' || c == 0xF1) {
if (c == 's' || c == 0xF1) {
if (_scrollPos < _filteredCount - 1) {
_scrollPos++;
return true;
@@ -217,16 +217,30 @@ public:
bool handleInput(char c) override {
int count = the_mesh.getDiscoveredCount();
// Shift+W: page up
if (c == 'W') {
int pageSize = (128 - 14 - 14) / the_mesh.getNodePrefs()->smallLineH();
if (pageSize < 3) pageSize = 3;
_scrollPos = max(0, _scrollPos - pageSize);
return true;
}
// W - scroll up
if (c == 'w' || c == 'W' || c == 0xF2) {
if (c == 'w' || c == 0xF2) {
if (_scrollPos > 0) {
_scrollPos--;
return true;
}
}
// Shift+S: page down
if (c == 'S') {
int pageSize = (128 - 14 - 14) / the_mesh.getNodePrefs()->smallLineH();
if (pageSize < 3) pageSize = 3;
_scrollPos = min(count - 1, _scrollPos + pageSize);
return true;
}
// S - scroll down
if (c == 's' || c == 'S' || c == 0xF1) {
if (c == 's' || c == 0xF1) {
if (_scrollPos < count - 1) {
_scrollPos++;
return true;
@@ -223,14 +223,28 @@ public:
}
bool handleInput(char c) override {
// Shift+W: page up
if (c == 'W') {
int pageSize = (128 - 14 - 14) / the_mesh.getNodePrefs()->smallLineH();
if (pageSize < 3) pageSize = 3;
_scrollPos = max(0, _scrollPos - pageSize);
return true;
}
// Scroll up
if (c == 'w' || c == 'W' || c == 0xF2) {
if (c == 'w' || c == 0xF2) {
if (_scrollPos > 0) { _scrollPos--; return true; }
return false;
}
// Shift+S: page down
if (c == 'S') {
int pageSize = (128 - 14 - 14) / the_mesh.getNodePrefs()->smallLineH();
if (pageSize < 3) pageSize = 3;
_scrollPos = min(_count - 1, _scrollPos + pageSize);
return true;
}
// Scroll down
if (c == 's' || c == 'S' || c == 0xF1) {
if (c == 's' || c == 0xF1) {
if (_scrollPos < _count - 1) { _scrollPos++; return true; }
return false;
}
+16 -2
View File
@@ -909,12 +909,26 @@ private:
bool handleFileListInput(char c) {
int totalItems = 1 + (int)_fileList.size();
if (c == 'w' || c == 'W' || c == 0xF2) {
// Shift+W: page up
if (c == 'W') {
int pageSize = (128 - 14 - 14) / _prefs->smallLineH();
if (pageSize < 3) pageSize = 3;
_selectedFile = max(0, _selectedFile - pageSize);
return true;
}
if (c == 'w' || c == 0xF2) {
if (_selectedFile > 0) { _selectedFile--; return true; }
return false;
}
if (c == 's' || c == 'S' || c == 0xF1) {
// Shift+S: page down
if (c == 'S') {
int pageSize = (128 - 14 - 14) / _prefs->smallLineH();
if (pageSize < 3) pageSize = 3;
_selectedFile = min(totalItems - 1, _selectedFile + pageSize);
return true;
}
if (c == 's' || c == 0xF1) {
if (_selectedFile < totalItems - 1) { _selectedFile++; return true; }
return false;
}
@@ -2996,8 +2996,17 @@ public:
// --- Normal browsing mode ---
// W/S: navigate
if (c == 'w' || c == 'W') {
// W/S: navigate, Shift+W/S: page scroll
if (c == 'W') {
// Shift+W: page up
int pageSize = (128 - 14 - 14) / _prefs->smallLineH();
if (pageSize < 3) pageSize = 3;
_cursor = max(0, _cursor - pageSize);
skipNonSelectable(-1);
Serial.printf("Settings: page up cursor=%d/%d\n", _cursor, _numRows);
return true;
}
if (c == 'w') {
if (_cursor > 0) {
_cursor--;
skipNonSelectable(-1);
@@ -3005,7 +3014,16 @@ public:
Serial.printf("Settings: cursor=%d/%d row=%d\n", _cursor, _numRows, _rows[_cursor].type);
return true;
}
if (c == 's' || c == 'S') {
if (c == 'S') {
// Shift+S: page down
int pageSize = (128 - 14 - 14) / _prefs->smallLineH();
if (pageSize < 3) pageSize = 3;
_cursor = min(_numRows - 1, _cursor + pageSize);
skipNonSelectable(1);
Serial.printf("Settings: page down cursor=%d/%d\n", _cursor, _numRows);
return true;
}
if (c == 's') {
if (_cursor < _numRows - 1) {
_cursor++;
skipNonSelectable(1);
@@ -1811,8 +1811,15 @@ public:
bool handleFileListInput(char c) {
int total = totalListItems();
// Shift+W: page up
if (c == 'W') {
int pageSize = (128 - 14 - 14) / _prefs->smallLineH();
if (pageSize < 3) pageSize = 3;
_selectedFile = max(0, _selectedFile - pageSize);
return true;
}
// W - scroll up
if (c == 'w' || c == 'W' || c == 0xF2) {
if (c == 'w' || c == 0xF2) {
if (_selectedFile > 0) {
_selectedFile--;
return true;
@@ -1820,8 +1827,15 @@ public:
return false;
}
// Shift+S: page down
if (c == 'S') {
int pageSize = (128 - 14 - 14) / _prefs->smallLineH();
if (pageSize < 3) pageSize = 3;
_selectedFile = min(total - 1, _selectedFile + pageSize);
return true;
}
// S - scroll down
if (c == 's' || c == 'S' || c == 0xF1) {
if (c == 's' || c == 0xF1) {
if (_selectedFile < total - 1) {
_selectedFile++;
return true;
+6 -3
View File
@@ -716,7 +716,8 @@ public:
#if defined(LilyGo_T5S3_EPaper_Pro)
display.drawTextCentered(display.width() / 2, 80, "toggle: " PRESS_LABEL);
#else
display.drawTextCentered(display.width() / 2, 72, "toggle: " PRESS_LABEL);
display.drawTextCentered(display.width() / 2, 68, "toggle: " PRESS_LABEL);
display.drawTextCentered(display.width() / 2, 78, "or press Enter key");
#endif
#endif
#ifdef MECK_WIFI_COMPANION
@@ -768,7 +769,8 @@ public:
#if defined(LilyGo_T5S3_EPaper_Pro)
display.drawTextCentered(display.width() / 2, 64, "advert: " PRESS_LABEL);
#else
display.drawTextCentered(display.width() / 2, 64 - 11, "advert: " PRESS_LABEL);
display.drawTextCentered(display.width() / 2, 57, "advert: " PRESS_LABEL);
display.drawTextCentered(display.width() / 2, 67, "or press Enter key");
#endif
#if ENV_INCLUDE_GPS == 1
} else if (_page == HomePage::GPS) {
@@ -1010,7 +1012,8 @@ public:
#if defined(LilyGo_T5S3_EPaper_Pro)
display.drawTextCentered(display.width() / 2, 64, "hibernate:" PRESS_LABEL);
#else
display.drawTextCentered(display.width() / 2, 64 - 11, "hibernate:" PRESS_LABEL);
display.drawTextCentered(display.width() / 2, 57, "hibernate: " PRESS_LABEL);
display.drawTextCentered(display.width() / 2, 67, "or press Enter key");
#endif
}
}