mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
1024323661
With a hardware keyboard attached, Enter inserted a newline and the only way to send was to reach for the send button, which is the opposite of what every desktop chat client does. MarkdownEditText gains an optional Enter listener and consumes Enter when it comes from a physical keyboard without Shift. Shift+Enter keeps inserting a newline, and a key event from the on-screen keyboard is identified by its VIRTUAL_KEYBOARD device id and left alone, so nothing changes for touch users. The key release is consumed as well, so no newline leaks out on key repeat. TextComposer passes its existing send lambda through, guarded by the same canSendTextMessage check the send button already uses, so Enter cannot send an empty message. Relates to https://github.com/element-hq/element-x-android/issues/860