mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
macOS: Allow non-cmd keyboard shortcuts to work on non-Latin layouts
Updates #10972
This commit is contained in:
parent
f6fbf662b4
commit
97b56d1db5
@ -317,9 +317,15 @@ unsafe fn parse_keystroke(native_event: id) -> Keystroke {
|
||||
let mut chars_ignoring_modifiers_and_shift =
|
||||
chars_for_modified_key(native_event.keyCode(), false, false);
|
||||
|
||||
// Honor ⌘ when Dvorak-QWERTY is used.
|
||||
// If the cmd key is down, we should use that layout (e.g. Dvorak-QWERTY)
|
||||
// Otherwise, if the base layout does not type ASCII, we prefer the command layout
|
||||
// and rely on the IME key as necessary.
|
||||
let chars_with_cmd = chars_for_modified_key(native_event.keyCode(), true, false);
|
||||
if command && chars_ignoring_modifiers_and_shift != chars_with_cmd {
|
||||
if chars_ignoring_modifiers_and_shift != chars_with_cmd
|
||||
&& (command
|
||||
|| (!chars_ignoring_modifiers_and_shift.is_ascii()
|
||||
&& chars_with_cmd.is_ascii()))
|
||||
{
|
||||
chars_ignoring_modifiers =
|
||||
chars_for_modified_key(native_event.keyCode(), true, shift);
|
||||
chars_ignoring_modifiers_and_shift = chars_with_cmd;
|
||||
|
Loading…
Reference in New Issue
Block a user