diff --git a/crates/horizon-client/src/game/control.rs b/crates/horizon-client/src/game/control.rs index bc584990d..e7fe21260 100644 --- a/crates/horizon-client/src/game/control.rs +++ b/crates/horizon-client/src/game/control.rs @@ -163,6 +163,16 @@ impl Game<'_> { self.debug_key(key, KeyAction::Release); } } + // The zoom extra's key, as the keyboard hook sees it. + if self.screen == Screen::Playing { + let action = arg(2)?; + if self.extras_key(physical, action != "up", false) { + if action == "tap" { + self.extras_key(physical, false, false); + } + return ok(); + } + } // 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" { @@ -228,9 +238,17 @@ impl Game<'_> { .into()); } match arg(2)? { - "down" => self.play_mouse(button, true)?, - "up" => self.play_mouse(button, false)?, + "down" => { + self.extras_mouse(button, true); + self.play_mouse(button, true)? + } + "up" => { + self.extras_mouse(button, false); + self.play_mouse(button, false)? + } "click" => { + self.extras_mouse(button, true); + self.extras_mouse(button, false); self.play_mouse(button, true)?; self.play_mouse(button, false)?; } diff --git a/crates/horizon-client/src/game/extras.rs b/crates/horizon-client/src/game/extras.rs index 7197725f7..284871fd6 100644 --- a/crates/horizon-client/src/game/extras.rs +++ b/crates/horizon-client/src/game/extras.rs @@ -59,7 +59,9 @@ impl Game<'_> { } /// Once per frame: the frame's time, and keys let go behind screens. pub(super) fn extras_frame(&mut self, elapsed: Duration) { - let playing = self.screen == Screen::Playing && self.title.is_none() && self.focused; + // Under agent control the window may lack focus without pausing. + let focused = self.focused || self.control.is_some(); + let playing = self.screen == Screen::Playing && self.title.is_none() && focused; if !playing || !self.settings.extras.zoom { self.extras.zoom.release(); }