mirror of
https://github.com/herdrdev/herdr.git
synced 2026-09-22 00:01:06 +00:00
fix(input): decode 0x1f as Ctrl+_ not Ctrl+- per ASCII standard (#2165)
* fix(input): decode 0x1f as Ctrl+_ not Ctrl+- per ASCII standard refs #2164 * fix(input): update control-byte matrix test for 0x1f -> Ctrl+_
This commit is contained in:
+2
-2
@@ -119,7 +119,7 @@ fn parse_legacy_ctrl_char(ch: char) -> Option<TerminalKey> {
|
||||
28 => Some(TerminalKey::new(KeyCode::Char('\\'), KeyModifiers::CONTROL)),
|
||||
29 => Some(TerminalKey::new(KeyCode::Char(']'), KeyModifiers::CONTROL)),
|
||||
30 => Some(TerminalKey::new(KeyCode::Char('^'), KeyModifiers::CONTROL)),
|
||||
31 => Some(TerminalKey::new(KeyCode::Char('-'), KeyModifiers::CONTROL)),
|
||||
31 => Some(TerminalKey::new(KeyCode::Char('_'), KeyModifiers::CONTROL)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -792,7 +792,7 @@ mod tests {
|
||||
(b'\x1c', '\\'),
|
||||
(b'\x1d', ']'),
|
||||
(b'\x1e', '^'),
|
||||
(b'\x1f', '-'),
|
||||
(b'\x1f', '_'),
|
||||
] {
|
||||
let key = parse_terminal_key_sequence(std::str::from_utf8(&[byte]).unwrap()).unwrap();
|
||||
assert_terminal_key_eq(
|
||||
|
||||
Reference in New Issue
Block a user