Edit word moves with Cmd on macOS, as InputQuirks does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-13 06:38:47 +02:00
parent 2aa3cd5afa
commit 98ec7bc509
2 changed files with 9 additions and 2 deletions
@@ -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;
+7 -2
View File
@@ -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 {