Use pre-composed key for Alt bindings on macOS

Fixes #7475.
This commit is contained in:
Kirill Chibisov 2023-12-28 22:30:51 +04:00
parent 91e3cd6a40
commit 6223cabe17
2 changed files with 8 additions and 1 deletions

View file

@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- `alacritty migrate` failing with nonexistent imports
- `Alt` bindings requiring composed key rather than pre-composed one on macOS
## 0.13.0

View file

@ -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()
};