mirror of
https://github.com/wez/wezterm.git
synced 2024-11-24 16:08:34 +03:00
remap Char codes to termwiz input codes
refs: https://github.com/wez/wezterm/issues/53
This commit is contained in:
parent
61fe33fbf6
commit
a9940ca56f
@ -185,6 +185,13 @@ impl WindowCallbacks for TermWindow {
|
||||
use ::window::KeyCode as WK;
|
||||
|
||||
let key_down = match key.key {
|
||||
// TODO: consider eliminating these codes from termwiz::input::KeyCode
|
||||
WK::Char('\r') | WK::Char('\n') => Some(KC::Enter),
|
||||
WK::Char('\t') => Some(KC::Tab),
|
||||
WK::Char('\u{08}') => Some(KC::Backspace),
|
||||
WK::Char('\u{1b}') => Some(KC::Escape),
|
||||
WK::Char('\u{7f}') => Some(KC::Delete),
|
||||
|
||||
WK::Char(c) => Some(KC::Char(c)),
|
||||
WK::Composed(ref s) => {
|
||||
tab.writer().write_all(s.as_bytes()).ok();
|
||||
|
Loading…
Reference in New Issue
Block a user