Add tab support to pancurses

This commit is contained in:
Alexandre Bury 2016-10-28 17:13:53 -07:00
parent 60bddf7e8d
commit 949b1e9632

View File

@ -100,9 +100,10 @@ impl backend::Backend for Concrete {
pancurses::Input::Character('\n') => Event::Key(Key::Enter), pancurses::Input::Character('\n') => Event::Key(Key::Enter),
// TODO: wait for a very short delay. If more keys are // TODO: wait for a very short delay. If more keys are
// pipelined, it may be an escape sequence. // pipelined, it may be an escape sequence.
pancurses::Input::Character('\u{1b}') => Event::Key(Key::Esc),
pancurses::Input::Character('\u{7f}') | pancurses::Input::Character('\u{7f}') |
pancurses::Input::Character('\u{8}') => Event::Key(Key::Backspace), pancurses::Input::Character('\u{8}') => Event::Key(Key::Backspace),
pancurses::Input::Character('\u{9}') => Event::Key(Key::Tab),
pancurses::Input::Character('\u{1b}') => Event::Key(Key::Esc),
pancurses::Input::Character(c) if 32 <= (c as u32) && pancurses::Input::Character(c) if 32 <= (c as u32) &&
(c as u32) <= 255 => { (c as u32) <= 255 => {
Event::Char(utf8::read_char(c as u8, || { Event::Char(utf8::read_char(c as u8, || {