Use git version of crossterm until next version is released

This commit is contained in:
Alexandre Bury 2020-03-06 08:24:26 -08:00
parent 602bffba15
commit 0c1244f580
2 changed files with 5 additions and 5 deletions

View File

@ -74,10 +74,11 @@ version = "1.5.3"
[dependencies.crossterm] [dependencies.crossterm]
optional = true optional = true
version = "0.16" git = "https://github.com/crossterm-rs/crossterm"
commit = "33b90c85c96e1452deb6e978ce06d9cb6f6da1a9"
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
signal-hook = "0.1.10" signal-hook = "0.1"
[dev-dependencies] [dev-dependencies]
rand = "0.7.0" rand = "0.7.0"

View File

@ -103,7 +103,6 @@ impl Backend {
// Don't echo user input, we'll take care of that // Don't echo user input, we'll take care of that
ncurses::noecho(); ncurses::noecho();
// This disables buffering and some input processing. // This disables buffering and some input processing.
// TODO: use ncurses::raw() ?
ncurses::raw(); ncurses::raw();
// This enables color support. // This enables color support.
ncurses::start_color(); ncurses::start_color();
@ -507,8 +506,8 @@ fn initialize_keymap() -> HashMap<i32, Event> {
for c in 1..=26 { for c in 1..=26 {
let event = match c { let event = match c {
// This is Ctrl+C // Ctrl-i and Ctrl-j are special, they use the same codes as Tab
// TODO: Don't exit here, but add this as a default callback // and Enter respecively. There's just no way to detect them. :(
9 => Event::Key(Key::Tab), 9 => Event::Key(Key::Tab),
10 => Event::Key(Key::Enter), 10 => Event::Key(Key::Enter),
other => Event::CtrlChar((b'a' - 1 + other as u8) as char), other => Event::CtrlChar((b'a' - 1 + other as u8) as char),