From 3e6052ac92b915c3af012c6ce331b386804e9334 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:28:22 +0200 Subject: [PATCH] control: keys reach a server's chat input The control socket's key command went straight to key_pressed, so Escape paused the game instead of closing the chat a server connection opens (remote_chat_key handles the real keyboard). Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/control.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/horizon-client/src/game/control.rs b/crates/horizon-client/src/game/control.rs index 921ca03db..bf4672140 100644 --- a/crates/horizon-client/src/game/control.rs +++ b/crates/horizon-client/src/game/control.rs @@ -580,6 +580,18 @@ impl Game<'_> { fn control_key_down(&mut self, key: KeyCode) -> Result<()> { self.physical_keys.insert(key); + // A server's chat input takes the keys first, as remote_chat_key does. + if self.remote_chat_open() { + use winit::keyboard::NamedKey; + let named = match key { + KeyCode::Escape => Some(NamedKey::Escape), + KeyCode::Enter | KeyCode::NumpadEnter => Some(NamedKey::Enter), + KeyCode::Backspace => Some(NamedKey::Backspace), + _ => None, + }; + self.remote_chat_input(named, None); + return Ok(()); + } if self.screen == Screen::Chat { self.chat_key_code(key, None); return Ok(());