diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 3aaec999b..4d8d6ce4b 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -334,8 +334,13 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) } // Printable char (ASCII) opens free text compose if (event->kbchar >= 32 && event->kbchar <= 126) { - LaunchFreetextWithDestination(NODENUM_BROADCAST); - return 1; + runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + // Immediately process the input in the new state (freetext) + return handleFreeTextInput(event); } break; @@ -385,10 +390,10 @@ bool CannedMessageModule::handleTabSwitch(const InputEvent *event) // RESTORE THIS! if (runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) updateDestinationSelectionList(); + requestFocus(); UIFrameEvent e; e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; - requestFocus(); notifyObservers(&e); screen->forceDisplay(); return true; @@ -985,6 +990,7 @@ int32_t CannedMessageModule::runOnce() default: // Only insert ASCII printable characters (32–126) if (this->payload >= 32 && this->payload <= 126) { + requestFocus(); if (this->cursor == this->freetext.length()) { this->freetext += (char)this->payload; } else { diff --git a/variants/portduino/platformio.ini b/variants/portduino/platformio.ini index 6da827508..5293b12b9 100644 --- a/variants/portduino/platformio.ini +++ b/variants/portduino/platformio.ini @@ -22,7 +22,6 @@ lib_deps = ${native_base.lib_deps} ${device-ui_base.lib_deps} build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunction-sections -fdata-sections -Wl,--gc-sections - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -D RAM_SIZE=16384 -D USE_X11=1 -D HAS_TFT=1 @@ -51,7 +50,6 @@ lib_deps = ${device-ui_base.lib_deps} board_level = extra build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections -Wl,--gc-sections - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -D RAM_SIZE=8192 -D USE_FRAMEBUFFER=1 -D LV_COLOR_DEPTH=32 @@ -81,7 +79,6 @@ lib_deps = ${device-ui_base.lib_deps} board_level = extra build_flags = ${native_base.build_flags} -O0 -fsanitize=address -lX11 -linput -lxkbcommon - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -D DEBUG_HEAP -D RAM_SIZE=16384 -D USE_X11=1