mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
usability fixes, fix t114 build src filter
This commit is contained in:
parent
0b97b23025
commit
db8e72791c
5 changed files with 18 additions and 11 deletions
|
|
@ -308,11 +308,13 @@ void UITask::loop() {
|
|||
|
||||
void UITask::handleButtonAnyPress() {
|
||||
MESH_DEBUG_PRINTLN("UITask: any press triggered");
|
||||
// called on any button press before other events, to wake up the display quickly
|
||||
// do not refresh the display here, as it may block the button handler
|
||||
if (_display != NULL) {
|
||||
if (!_display->isOn()) {
|
||||
_displayWasOn = _display->isOn(); // Track display state before any action
|
||||
if (!_displayWasOn) {
|
||||
_display->turnOn();
|
||||
}
|
||||
_need_refresh = true;
|
||||
_auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer
|
||||
}
|
||||
}
|
||||
|
|
@ -320,12 +322,17 @@ void UITask::handleButtonAnyPress() {
|
|||
void UITask::handleButtonShortPress() {
|
||||
MESH_DEBUG_PRINTLN("UITask: short press triggered");
|
||||
if (_display != NULL) {
|
||||
if (_display->isOn()) {
|
||||
// If display is on and showing message preview, clear it
|
||||
// Only clear message preview if display was already on before button press
|
||||
if (_displayWasOn) {
|
||||
// If display was on and showing message preview, clear it
|
||||
if (_origin[0] && _msg[0]) {
|
||||
clearMsgPreview();
|
||||
} else {
|
||||
// Otherwise, refresh the display
|
||||
_need_refresh = true;
|
||||
}
|
||||
}
|
||||
// Note: Display turn-on and auto-off timer extension are handled by handleButtonAnyPress
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue