diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2023-12-28 22:30:51 +0400 |
---|---|---|
committer | Kirill Chibisov <contact@kchibisov.com> | 2023-12-30 09:42:02 +0400 |
commit | 6223cabe17945a86ff4adeb3dfb84c90186f4ea3 (patch) | |
tree | 46b82ac793e70b7aa25f652c6ea019dffe44f9aa /alacritty/src | |
parent | 91e3cd6a40aa98cf9a76e7cd3534f7fbb0a27098 (diff) | |
download | r-alacritty-6223cabe17945a86ff4adeb3dfb84c90186f4ea3.tar.gz r-alacritty-6223cabe17945a86ff4adeb3dfb84c90186f4ea3.tar.bz2 r-alacritty-6223cabe17945a86ff4adeb3dfb84c90186f4ea3.zip |
Use pre-composed key for `Alt` bindings on macOS
Fixes #7475.
Diffstat (limited to 'alacritty/src')
-rw-r--r-- | alacritty/src/input/keyboard.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/alacritty/src/input/keyboard.rs b/alacritty/src/input/keyboard.rs index 423f8bae..6d2abea1 100644 --- a/alacritty/src/input/keyboard.rs +++ b/alacritty/src/input/keyboard.rs @@ -172,7 +172,13 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> { // the time. However what we want is to manually lowercase the character to account // for both small and capital letters on regular characters at the same time. let logical_key = if let Key::Character(ch) = key.logical_key.as_ref() { - Key::Character(ch.to_lowercase().into()) + // Match `Alt` bindings without `Alt` being applied, otherwise they use the + // composed chars, which are not intuitive to bind. + if cfg!(target_os = "macos") && mods.alt_key() { + key.key_without_modifiers() + } else { + Key::Character(ch.to_lowercase().into()) + } } else { key.logical_key.clone() }; |