diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-08-01 04:27:50 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-01 04:27:50 +0300 |
| commit | b76adc155d979705a353fd6dc87c702f9dfc6c22 (patch) | |
| tree | f613254e0cfbfd2b4450a6a5f3ee7c0ba8136976 /src/pane/input.rs | |
| parent | 8d190eddda2c74afa3dc043f8ec8020ffd7b5a94 (diff) | |
fix(input): preserve native key lifecycle across routing (#2142)
refs #2077
Co-authored-by: Jonathan Liebig <jonathan.liebig@gmail.com>
Diffstat (limited to 'src/pane/input.rs')
| -rw-r--r-- | src/pane/input.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pane/input.rs b/src/pane/input.rs index 6906e77d..38e8138b 100644 --- a/src/pane/input.rs +++ b/src/pane/input.rs @@ -1,5 +1,5 @@ pub(super) fn ghostty_key_event_from_terminal_key( - key: crate::input::TerminalKey, + key: &crate::input::TerminalKey, ) -> Option<crate::ghostty::KeyEvent> { let mut event = crate::ghostty::KeyEvent::new().ok()?; event.set_action(match key.kind { @@ -32,7 +32,7 @@ pub(super) fn ghostty_key_event_from_terminal_key( Some(event) } -pub(super) fn ghostty_prefers_herdr_text_encoding(key: crate::input::TerminalKey) -> bool { +pub(super) fn ghostty_prefers_herdr_text_encoding(key: &crate::input::TerminalKey) -> bool { matches!(key.code, crossterm::event::KeyCode::Char(_)) } @@ -168,7 +168,7 @@ pub(super) fn ghostty_mouse_event_from_wheel_kind( Some(event) } -fn ghostty_key_text(key: crate::input::TerminalKey) -> Option<String> { +fn ghostty_key_text(key: &crate::input::TerminalKey) -> Option<String> { match key.code { crossterm::event::KeyCode::Char(c) => Some( key.shifted_codepoint @@ -180,7 +180,7 @@ fn ghostty_key_text(key: crate::input::TerminalKey) -> Option<String> { } } -fn ghostty_unshifted_codepoint(key: crate::input::TerminalKey) -> Option<u32> { +fn ghostty_unshifted_codepoint(key: &crate::input::TerminalKey) -> Option<u32> { match key.code { crossterm::event::KeyCode::Char(c) => Some(c as u32), _ => None, |
