-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send a message by pressing Ctrl
+ Return
or Command ⌘
+ Return
#245
Send a message by pressing Ctrl
+ Return
or Command ⌘
+ Return
#245
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this project is still a work-in-progress and we don't support editing an existing message, I think it's best to adopt the least-surprising UX behavior of only sending a message when Ctrl + Enter is pressed, rather than just Enter alone.
This behavior is also more common in my experience with other messaging clients. In addition, it errs on the side of caution by preventing a user from accidentally sending a message before they were ready to send it.
Thus, a plain (unmodified) Enter key press should insert a new line.
Finally, don't forget that different platforms use different keys for their main "modifier" key. Windows and Linux do typically use Ctrl, but macOS uses Command ⌘. So make sure your code works with all platforms here.
Of course, in the future, the precise behavior of Enter would be a user-customizable setting.
@kevinaboos So I'm only adding window and mac shortcuts for sending messages now. Wait until we can edit the message, then do a carriage return to add a new line. |
enter
and ctrl + enter
shortcuts when sending messages and can edit messages on multiple lines.ctrl + enter
shortcuts to send new message.
ctrl + enter
shortcuts to send new message.ctrl + enter
and ⌘ + enter
shortcuts to send new message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Technically speaking, this isn't exactly the correct behavior that we want, since this will result in the message being sent if Ctrl + Return is pressed on macOS, and if Logo + Return is pressed on Windows or Linux.
However, I think this is an improvement that should be made within Makepad's TextInput
widget, so I'll accept this PR for now since it still mostly works.
@kevinaboos But if it is added to the |
No no, to clarify what I meant, the |
oh,ok, I misunderstood. |
ctrl + enter
and ⌘ + enter
shortcuts to send new message.Ctrl
+ Return
or Command ⌘
+ Return
So I implemented this in Makepad, but on second thought I don't think it's necessary, as it's not much of an improvement over what you've done in this PR. |
Just as a heads up, I implemented a different improvement to Makepad and am now using it in #252; this makes the code from this PR slightly more efficient while also avoiding platform-specific code within the Robrix app itself (which is one of our goals for makepad/robius) |
You actually right. Thanks. |
Shift
+Return
inserts a new line, as handled by Makepad'sTextInput
widget.Return
by itself will currently do nothing.Ctrl + Return
orCommand ⌘
+Return
will send the message, which behaves just like clicking theSend
button.