getch for Windows and Unix.
getch
Cargo.toml
[dependencies] getch-rs = "0.1"
main.rs
use getch_rs::Getch; fn main() { let g = Getch::new(); if let Ok(key) = g.getch() { println!("{:?}", key); } }
$ cargo run --example getch