fix: send message on main Return key in MUI composer (X11/native-tft)#345
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe message input handler converts raw carriage-return keyboard events into LVGL ready events, allowing physical Enter to trigger the existing message-send logic. ChangesMessage submission
Estimated code review effort: 2 (Simple) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
LVGL's X11 input driver maps only XK_KP_Enter to LV_KEY_ENTER; the main Return key falls through XLookupString as a raw '\r', which the one-line message textarea silently discards (lv_textarea.c one_line filter). As a result, typing worked but pressing Enter never sent the message - only the on-screen keyboard checkmark did (lv_keyboard sends LV_EVENT_READY directly). Handle LV_EVENT_KEY == '\r' in ui_event_message_ready and route it into the existing LV_EVENT_READY send logic. Keypad Enter is unaffected (its LV_KEY_ENTER already triggers a nested LV_EVENT_READY from the textarea class handler, and '\n' != '\r' avoids any double-send). The space+return CR_REPLACEMENT newline trick keeps working, now also with the physical Return key.
7aeb752 to
26ac5de
Compare
Fixes #344
On the
native-tft(X11) build, the main Return key arrives as a raw'\r'because LVGL's X11 driver only mapsXK_KP_EntertoLV_KEY_ENTER. The one-line composer textarea silently discards'\r', soLV_EVENT_READYnever fires and the message is never sent — only the on-screen keyboard checkmark (or keypad Enter) worked.Change
ui_event_message_readyis already registered withLV_EVENT_ALL, so it receives theLV_EVENT_KEYevent after the textarea class handler drops the char. This PR handlesLV_EVENT_KEY == '\r'there and routes it into the existingLV_EVENT_READYsend logic.LV_KEY_ENTER('\n'), which already triggers a nestedLV_EVENT_READYfrom the textarea class handler, and'\n' != '\r'so this handler ignores them.CR_REPLACEMENTnewline trick keeps working, now also with the physical Return key.TFTView_320x240.cpp.See #344 for the full diagnosis.
Summary by CodeRabbit