diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 2b294bf99..690998a18 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -8358,15 +8358,17 @@ impl ApplicationHandler for Game<'_> { WindowEvent::KeyboardInput { event, .. } if self.screen == Screen::WorldOptions => { self.world_options_key(&event) } - WindowEvent::KeyboardInput { event, .. } if self.screen == Screen::Options => { + // Options consumes presses; releases still reach the bound + // gameplay mapping below, including sneak/sprint toggles. + WindowEvent::KeyboardInput { event, .. } + if self.screen == Screen::Options && event.state == ElementState::Pressed => + { if let Some(shortcut) = self.edit_shortcut(&event) && self.options_shortcut(shortcut) { return Ok(()); } - if event.state == ElementState::Pressed - && let PhysicalKey::Code(key) = event.physical_key - { + if let PhysicalKey::Code(key) = event.physical_key { self.options_key(key, event.text.as_deref())?; } } diff --git a/crates/horizon-client/src/game/control.rs b/crates/horizon-client/src/game/control.rs index 2ab1245cf..5d9954a7b 100644 --- a/crates/horizon-client/src/game/control.rs +++ b/crates/horizon-client/src/game/control.rs @@ -163,8 +163,9 @@ impl Game<'_> { self.debug_key(key, KeyAction::Release); } } - // Physical key presses follow the key binds like the keyboard does. - let key = if matches!(self.screen, Screen::Chat | Screen::Options) { + // Text screens consume raw presses; releases follow key binds. + let typing = matches!(self.screen, Screen::Chat | Screen::Options); + let key = if typing && arg(2)? != "up" { key } else { match self.settings.keys.translate(key) { diff --git a/crates/horizon-client/src/game/options.rs b/crates/horizon-client/src/game/options.rs index f9f7fc617..dc78d7525 100644 --- a/crates/horizon-client/src/game/options.rs +++ b/crates/horizon-client/src/game/options.rs @@ -26,6 +26,9 @@ impl Game<'_> { } /// Open the options screens (OptionsScreen) from the title or pause menu. pub(super) fn open_options(&mut self, from_title: bool) { + // Gameplay keys must not stay held behind the options screen, where + // bindings can also change before the physical key is released. + self.keys.clear(); self.screen = Screen::Options; self.options_from_title = from_title; let ui = &mut self.ui.options;