aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2024-02-23 15:55:11 -0700
committerJosh Rahm <rahm@google.com>2024-02-23 15:55:11 -0700
commit567f3430227d36b9b37e655717c0aba348609913 (patch)
tree01d6d70131021d1ff66235c74d9cadf01273282c
parentbe463eec9659caf469176491da34fcf5cacab000 (diff)
downloadr-alacritty-567f3430227d36b9b37e655717c0aba348609913.tar.gz
r-alacritty-567f3430227d36b9b37e655717c0aba348609913.tar.bz2
r-alacritty-567f3430227d36b9b37e655717c0aba348609913.zip
Unlock more bindings from the keyboard
-rw-r--r--alacritty/src/input/keyboard.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/alacritty/src/input/keyboard.rs b/alacritty/src/input/keyboard.rs
index b7635bd9..8f97bc71 100644
--- a/alacritty/src/input/keyboard.rs
+++ b/alacritty/src/input/keyboard.rs
@@ -126,7 +126,7 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
self.ctx.modifiers().state().alt_key()
}
},
- _ => text.len() == 1 && alt_send_esc,
+ _ => alt_send_esc,
}
}
@@ -141,11 +141,19 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
return true;
}
- let disambiguate = mode.contains(TermMode::DISAMBIGUATE_ESC_CODES)
+ let mut disambiguate = mode.contains(TermMode::DISAMBIGUATE_ESC_CODES)
&& (key.logical_key == Key::Named(NamedKey::Escape)
|| (!mods.is_empty() && mods != ModifiersState::SHIFT)
|| key.location == KeyLocation::Numpad);
+ if !(mods & ModifiersState::CONTROL).is_empty() {
+ if text.len() == 1 && text.chars().nth(0).unwrap() < ' ' {
+ disambiguate = false;
+ } else {
+ disambiguate = true;
+ }
+ }
+
match key.logical_key {
_ if disambiguate => true,
// Exclude all the named keys unless they have textual representation.