Remap backspace key

This commit is contained in:
mars 2022-10-05 23:37:46 -06:00
parent 0894a0ba3c
commit ca50d28227
1 changed files with 3 additions and 2 deletions

View File

@ -482,6 +482,7 @@ impl App {
) -> Option<&'static str> {
use winit::event::VirtualKeyCode::*;
match keycode {
Back => Some("\x7f"),
Up => Some("\x1b[A"),
Down => Some("\x1b[B"),
Right => Some("\x1b[C"),
@ -510,8 +511,8 @@ impl App {
log::debug!("Received character: {:?}", c);
match c {
'\u{7f}' => {
// We use a special escape code for the delete key.
'\u{7f}' | '\u{8}' => {
// We use a special escape code for the delete and backspace keys.
log::debug!("Ignoring.");
return;
}