Make enter and tab key work again in crossterm backend (#395)

It looks like new crossterm returns a dedicated enum item for the enter
and tab key instead of the `\n` and `\t` character.

Fixes #394.
This commit is contained in:
mara 2019-10-25 20:22:23 +02:00 committed by Alexandre Bury
parent dac0f5a67e
commit 985e4ebf96

View File

@ -90,9 +90,9 @@ impl Backend {
CKeyEvent::PageDown => Event::Key(Key::PageDown),
CKeyEvent::Delete => Event::Key(Key::Del),
CKeyEvent::Insert => Event::Key(Key::Ins),
CKeyEvent::Enter => Event::Key(Key::Enter),
CKeyEvent::Tab => Event::Key(Key::Tab),
CKeyEvent::F(n) => Event::Key(Key::from_f(n)),
CKeyEvent::Char('\n') => Event::Key(Key::Enter),
CKeyEvent::Char('\t') => Event::Key(Key::Tab),
CKeyEvent::Char(c) => Event::Char(c),
CKeyEvent::Ctrl('c') => Event::Exit,
CKeyEvent::Ctrl(c) => Event::CtrlChar(c),