project-robius / robrix

Robrix: a multi-platform Matrix chat client written in Rust using the Makepad UI toolkit and the Robius app dev framework
MIT License
120 stars 19 forks source link

Send a message by pressing `Ctrl` + `Return` or `Command ⌘` + `Return` #245

Closed tyreseluo closed 2 weeks ago

tyreseluo commented 2 weeks ago
tyreseluo commented 2 weeks ago

@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.

tyreseluo commented 2 weeks ago

@kevinaboos But if it is added to the TextInput component in makepad does it affect the situation in other projects when they also use the relevant shortcut, but not ctrl + enter or logo + enter.But either way, for now it's just an option for the current situation. Later on it will still allow user to do customization as well.

kevinaboos commented 2 weeks ago

@kevinaboos But if it is added to the TextInput component in makepad does it affect the situation in other projects when they also use the relevant shortcut, but not ctrl + enter or logo + enter.But either way, for now it's just an option for the current situation. Later on it will still allow for customization as well.

No no, to clarify what I meant, the TextInput widget should emit an action that includes the modifier keys held down whilst the Return key was pressed. I will add this to Makepad later.

tyreseluo commented 2 weeks ago

oh,ok, I misunderstood.

kevinaboos commented 2 weeks ago

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.

kevinaboos commented 1 week ago

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)

tyreseluo commented 1 week ago

You actually right. Thanks.