minicrossterm/examples/Crossterm 0.3.1/bin.rs

46 lines
1018 B
Rust
Raw Normal View History

//! This bin folder can be used to try the examples out located in the examples directory.
//!
//! All you need to do is:
//!
//! - Download the crossterm source code.
//! - Add this in the Cargo.toml file:
//! ``` [[bin]]
//! name = "example_bin"
//! path = "./examples/bin.rs"
//! ```
//!
//! - Run program with: `cargo run`
extern crate crossterm;
2018-07-28 02:44:38 +10:00
use crossterm::Terminal;
// mod terminal;
// mod color;
// mod cursor;
// mod crossterm_type;
2018-07-28 02:44:38 +10:00
// mod input;
2018-07-28 02:44:38 +10:00
//use input::keyboard::{async_input, input as stdin};
2018-07-22 22:55:14 +10:00
use std::{thread, time};
2018-07-22 22:55:14 +10:00
fn main() {
2018-07-28 18:09:09 +10:00
<<<<<<< HEAD
let term = Terminal::new();
let mut cursor = term.cursor();
cursor.goto(10,10);
cursor.print("test");
let stdin = term.input();
let line = stdin.read_line();
println!("{:?}", line)
2018-07-22 22:55:14 +10:00
}
2018-07-28 18:09:09 +10:00
=======
{
let mut terminal = Terminal::new();
terminal.enable_alternate_screen();
thread::sleep(time::Duration::from_millis(5000));
}
2018-07-28 18:09:09 +10:00
}
>>>>>>> 403d0668a72e9ca04a05bbe137a30d6a2d9ba90c