diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-28 00:32:35 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-28 00:32:35 +0300 |
| commit | f8c4d6a5f1bd4bcaee43ba3e1373465cd960cdc3 (patch) | |
| tree | 10e9d52f05b476f83a3ee88a87a7c8f7aca9eca6 /src/input.rs | |
| parent | 787786c62009f6c27a0091b61017ae5ad5c95c0e (diff) | |
feat: add per-agent sound overrides
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/input.rs b/src/input.rs index dbbf65df..f7c1f5c2 100644 --- a/src/input.rs +++ b/src/input.rs @@ -36,9 +36,17 @@ fn try_encode_csi_u(key: &KeyEvent) -> Option<Vec<u8>> { // understood. Even Ghostty sends these in legacy format with kitty mode on. // Only use CSI u for character keys and keys without legacy representations. match key.code { - KeyCode::Up | KeyCode::Down | KeyCode::Left | KeyCode::Right - | KeyCode::Home | KeyCode::End | KeyCode::PageUp | KeyCode::PageDown - | KeyCode::Insert | KeyCode::Delete | KeyCode::F(_) => { + KeyCode::Up + | KeyCode::Down + | KeyCode::Left + | KeyCode::Right + | KeyCode::Home + | KeyCode::End + | KeyCode::PageUp + | KeyCode::PageDown + | KeyCode::Insert + | KeyCode::Delete + | KeyCode::F(_) => { return None; // let legacy handle these } _ => {} @@ -262,10 +270,7 @@ mod tests { #[test] fn legacy_ctrl_shift_end() { - let key = KeyEvent::new( - KeyCode::End, - KeyModifiers::CONTROL | KeyModifiers::SHIFT, - ); + let key = KeyEvent::new(KeyCode::End, KeyModifiers::CONTROL | KeyModifiers::SHIFT); assert_eq!(encode_key(key, false), b"\x1b[1;6F"); } @@ -330,10 +335,7 @@ mod tests { #[test] fn kitty_ctrl_shift_enter() { - let key = KeyEvent::new( - KeyCode::Enter, - KeyModifiers::CONTROL | KeyModifiers::SHIFT, - ); + let key = KeyEvent::new(KeyCode::Enter, KeyModifiers::CONTROL | KeyModifiers::SHIFT); assert_eq!(encode_key(key, true), b"\x1b[13;6u"); } } |
