aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/input.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-07-20 17:42:47 +0000
committerGitHub <noreply@github.com>2023-07-20 17:42:47 +0000
commit2101d5ac37d65114781a84b889d96eafe768860a (patch)
treebcce739b4ec65e6676d3c0156676435f8fd15a0b /alacritty/src/input.rs
parentbf671412cef2e99d0c2ee3d0350dc4576fb63725 (diff)
downloadr-alacritty-2101d5ac37d65114781a84b889d96eafe768860a.tar.gz
r-alacritty-2101d5ac37d65114781a84b889d96eafe768860a.tar.bz2
r-alacritty-2101d5ac37d65114781a84b889d96eafe768860a.zip
Fix keys like `+` not working on neo layouts
The key_without_modifier removes all the modifiers including the multiple shift levels, which is not desired. In alacritty we just wanted to treat uppercase and lowercase latters the same, which we can with the help of builtin functions.
Diffstat (limited to 'alacritty/src/input.rs')
-rw-r--r--alacritty/src/input.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs
index 19996c72..a8fb09b5 100644
--- a/alacritty/src/input.rs
+++ b/alacritty/src/input.rs
@@ -1050,10 +1050,11 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
for i in 0..self.ctx.config().key_bindings().len() {
let binding = &self.ctx.config().key_bindings()[i];
- // When the logical key is some named key, use it, otherwise fallback to
- // key without modifiers to account for bindings.
- let logical_key = if matches!(key.logical_key, Key::Character(_)) {
- key.key_without_modifiers()
+ // We don't want the key without modifier, because it means something else most of
+ // the time. However what we want is to manually lowercase the character to account
+ // for both small and capital latters 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())
} else {
key.logical_key.clone()
};