Files
element-x-android/libraries/textcomposer
hayaksi1 1024323661 Send a message with Enter on a physical keyboard, Shift+Enter for a new line
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
2026-08-09 04:09:30 +03:00
..
2023-12-28 12:03:23 +01:00