From 140f7a0871e1e621dd0fc81a1f18cbfb1f8872dd Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Mon, 8 Jan 2024 11:10:32 +0000 Subject: [PATCH] Allow either Enter or Return for sending a message. --- voxygen/src/hud/chat.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index 056347c9cc..85c482f7f3 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -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| {