2018-08-12 22:51:08 +10:00
|
|
|
extern crate crossterm;
|
|
|
|
|
2019-01-28 07:16:14 +11:00
|
|
|
use crossterm::{Crossterm, Screen, Color};
|
2018-08-12 22:51:08 +10:00
|
|
|
|
|
|
|
/// use the `Crossterm` to get an instance to the cursor module | demonstration.
|
2018-11-22 03:48:22 +11:00
|
|
|
pub fn crossterm() {
|
2018-08-12 22:51:08 +10:00
|
|
|
// Create the crossterm type to access different modules.
|
2018-11-15 02:53:27 +11:00
|
|
|
let crossterm = Crossterm::new();
|
2018-08-12 22:51:08 +10:00
|
|
|
|
|
|
|
// pass a reference to the current screen.
|
2018-10-08 04:15:17 +11:00
|
|
|
let cursor = crossterm.cursor();
|
|
|
|
let color = crossterm.color();
|
|
|
|
let terminal = crossterm.terminal();
|
2019-01-28 07:16:14 +11:00
|
|
|
let terminal = crossterm.input();
|
|
|
|
let style = crossterm.style("Black font on green background").with(Color::Black).on(Color::Green);
|
2018-08-12 22:51:08 +10:00
|
|
|
|
2019-01-28 07:16:14 +11:00
|
|
|
// TODO: perform some actions with the instances above.
|
2018-08-12 22:51:08 +10:00
|
|
|
}
|