aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/input/keyboard.rs
diff options
context:
space:
mode:
authorjadedpasta <86900272+jadedpasta@users.noreply.github.com>2024-05-23 13:36:14 -0500
committerJosh Rahm <rahm@google.com>2024-08-14 15:42:41 -0600
commit55f037d96230d4aa3ee8e85be7b22a2bbbfff216 (patch)
tree3c1f6c2e56a7a6d2c85c46acc16bee3a7e067c69 /alacritty/src/input/keyboard.rs
parentef8ce1ecaf0746ec9186beee010a86cae4c9338a (diff)
downloadr-alacritty-55f037d96230d4aa3ee8e85be7b22a2bbbfff216.tar.gz
r-alacritty-55f037d96230d4aa3ee8e85be7b22a2bbbfff216.tar.bz2
r-alacritty-55f037d96230d4aa3ee8e85be7b22a2bbbfff216.zip
Fix Kitty protocol reporting shifted keycodes
The [kitty keyboard protocol][1] explicitly requires that the *un-shifted* version of the pressed key is used to report the primary code point in `CSI code-point;modifiers u` sequences. > Note that the codepoint used is always the lower-case (or more > technically, un-shifted) version of the key. If the user presses, for > example, ctrl+shift+a the escape code would be CSI 97;modifiers u. It > must not be CSI 65; modifiers u. Alacritty's current behavior is to report the shifted version when shift is pressed, and the un-shifted version otherwise: ```console # Note that you'll have to kill Alacritty after running this to get # control back! $ echo -ne '\x1b[>1u'; cat ^[[97;5u^[[65;6u ``` The above was generated by pressing `CTRL`+`a` followed by `CTRL`+`SHIFT`+`a` after running the command. Here `97` and `65` are the codepoints for `a` and `A` respectively. This change makes Alacritty match the protocol (and Kitty's) behavior. With this change applied, `97` is reported for both `CTRL`+`a` and `CTRL`+`SHIFT`+`a`. [1]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#key-codes
Diffstat (limited to 'alacritty/src/input/keyboard.rs')
-rw-r--r--alacritty/src/input/keyboard.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/alacritty/src/input/keyboard.rs b/alacritty/src/input/keyboard.rs
index 9c7ef4bd..a099196a 100644
--- a/alacritty/src/input/keyboard.rs
+++ b/alacritty/src/input/keyboard.rs
@@ -381,7 +381,7 @@ impl SequenceBuilder {
{
format!("{unicode_key_code}:{alternate_key_code}")
} else {
- alternate_key_code.to_string()
+ unicode_key_code.to_string()
};
Some(SequenceBase::new(payload.into(), SequenceTerminator::Kitty))