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:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user