From bdbedad38af3503fc804a5a99e47aaf1ca70fb55 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 15 Apr 2023 19:45:12 -0700 Subject: [PATCH] kitty keyboard: more test cases for #2546 --- wezterm-input-types/src/lib.rs | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/wezterm-input-types/src/lib.rs b/wezterm-input-types/src/lib.rs index 3669414fc..5bcc26235 100644 --- a/wezterm-input-types/src/lib.rs +++ b/wezterm-input-types/src/lib.rs @@ -2279,6 +2279,56 @@ mod test { .encode_kitty(flags), "\x1b[49;4u".to_string() ); + + assert_eq!( + KeyEvent { + key: KeyCode::Char('i'), + modifiers: Modifiers::SHIFT | Modifiers::CTRL, + leds: KeyboardLedStatus::empty(), + repeat_count: 1, + key_is_down: true, + raw: None + } + .encode_kitty(flags), + "\x1b[105;6u".to_string() + ); + assert_eq!( + KeyEvent { + key: KeyCode::Char('I'), + modifiers: Modifiers::SHIFT | Modifiers::CTRL, + leds: KeyboardLedStatus::empty(), + repeat_count: 1, + key_is_down: true, + raw: None + } + .encode_kitty(flags), + "\x1b[105;6u".to_string() + ); + + assert_eq!( + KeyEvent { + key: KeyCode::Char('i'), + modifiers: Modifiers::ALT | Modifiers::SHIFT | Modifiers::CTRL, + leds: KeyboardLedStatus::empty(), + repeat_count: 1, + key_is_down: true, + raw: None + } + .encode_kitty(flags), + "\x1b[105;8u".to_string() + ); + assert_eq!( + KeyEvent { + key: KeyCode::Char('I'), + modifiers: Modifiers::ALT | Modifiers::SHIFT | Modifiers::CTRL, + leds: KeyboardLedStatus::empty(), + repeat_count: 1, + key_is_down: true, + raw: None + } + .encode_kitty(flags), + "\x1b[105;8u".to_string() + ); } #[test]