mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-22 04:54:47 +00:00
Make back buttons work in canned messages
This commit is contained in:
parent
656e7755e3
commit
f12145908d
@ -487,7 +487,7 @@ int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CANCEL
|
// CANCEL
|
||||||
if (event->inputEvent == INPUT_BROKER_CANCEL) {
|
if (event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_BACK) {
|
||||||
runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||||
searchQuery = "";
|
searchQuery = "";
|
||||||
|
|
||||||
@ -516,7 +516,8 @@ bool CannedMessageModule::handleMessageSelectorInput(const InputEvent *event, bo
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// === Handle Cancel key: go inactive, clear UI state ===
|
// === Handle Cancel key: go inactive, clear UI state ===
|
||||||
if (event->inputEvent == INPUT_BROKER_CANCEL) {
|
if (runState != CANNED_MESSAGE_RUN_STATE_INACTIVE &&
|
||||||
|
(event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_BACK)) {
|
||||||
runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||||
freetext = "";
|
freetext = "";
|
||||||
cursor = 0;
|
cursor = 0;
|
||||||
@ -711,7 +712,7 @@ bool CannedMessageModule::handleFreeTextInput(const InputEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cancel (dismiss freetext screen)
|
// Cancel (dismiss freetext screen)
|
||||||
if (event->inputEvent == INPUT_BROKER_CANCEL) {
|
if (event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_BACK) {
|
||||||
runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||||
UIFrameEvent e;
|
UIFrameEvent e;
|
||||||
e.action = UIFrameEvent::Action::REGENERATE_FRAMESET;
|
e.action = UIFrameEvent::Action::REGENERATE_FRAMESET;
|
||||||
@ -780,7 +781,7 @@ int CannedMessageModule::handleEmotePickerInput(const InputEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cancel returns to freetext
|
// Cancel returns to freetext
|
||||||
if (event->inputEvent == INPUT_BROKER_CANCEL) {
|
if (event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_BACK) {
|
||||||
runState = CANNED_MESSAGE_RUN_STATE_FREETEXT;
|
runState = CANNED_MESSAGE_RUN_STATE_FREETEXT;
|
||||||
screen->forceDisplay();
|
screen->forceDisplay();
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user