minicrossterm/examples/Crossterm 0.3.1/bin.rs

37 lines
788 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() {
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
}