mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'chat-bits' into 'master'
Allow either Enter or Return for sending a message. See merge request veloren/veloren!4247
This commit is contained in:
commit
7ecf0487f1
@ -709,9 +709,9 @@ impl<'a> Widget for Chat<'a> {
|
||||
} else if keyboard_capturer == Some(id) {
|
||||
events.push(Event::Focus(state.ids.chat_input));
|
||||
}
|
||||
// If enter is pressed and the input box is not empty, send the current message.
|
||||
// If either Return or Enter is pressed and the input box is not empty, send the current message.
|
||||
else if ui.widget_input(state.ids.chat_input).presses().key().any(
|
||||
|key_press| matches!(key_press.key, Key::Return if !state.input.message.is_empty()),
|
||||
|key_press| matches!(key_press.key, Key::Return | Key::NumPadEnter if !state.input.message.is_empty()),
|
||||
) {
|
||||
let msg = state.input.message.clone();
|
||||
state.update(|s| {
|
||||
|
Loading…
Reference in New Issue
Block a user