diff --git a/crates/horizon-client/examples/chat_screen_fixture.rs b/crates/horizon-client/examples/chat_screen_fixture.rs index a264af322..c5cba6b9d 100644 --- a/crates/horizon-client/examples/chat_screen_fixture.rs +++ b/crates/horizon-client/examples/chat_screen_fixture.rs @@ -96,6 +96,8 @@ fn main() -> horizon_client::Result<()> { "escape" => K::Escape, _ => K::KeyA, }; + // InputQuirks.EDIT_SHORTCUT_KEY_MODIFIER: Cmd, not Ctrl, on macOS. + let ctrl = ctrl && !cfg!(target_os = "macos"); if screen.key(&m, &c, &history, key, shift, ctrl) != ChatAction::None { closed = true; break; diff --git a/crates/horizon-client/src/game/chat.rs b/crates/horizon-client/src/game/chat.rs index c7d381dee..d560df45e 100644 --- a/crates/horizon-client/src/game/chat.rs +++ b/crates/horizon-client/src/game/chat.rs @@ -425,8 +425,13 @@ impl Game<'_> { } /// A key (and the text it typed) while the chat screen is open. pub(super) fn chat_key_code(&mut self, key: KeyCode, typed_text: Option<&str>) { - let ctrl = - self.keys.contains(&KeyCode::ControlLeft) || self.keys.contains(&KeyCode::ControlRight); + // InputQuirks.EDIT_SHORTCUT_KEY_MODIFIER: Cmd on macOS, Ctrl elsewhere. + let (left, right) = if cfg!(target_os = "macos") { + (KeyCode::SuperLeft, KeyCode::SuperRight) + } else { + (KeyCode::ControlLeft, KeyCode::ControlRight) + }; + let ctrl = self.keys.contains(&left) || self.keys.contains(&right); let shift = self.keys.contains(&KeyCode::ShiftLeft) || self.keys.contains(&KeyCode::ShiftRight); match key {