extern crate crossterm;
use self::crossterm::cursor::{cursor, TerminalCursor};
use self::crossterm::Screen;
pub fn goto() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
cursor.goto(10, 5);
}
pub fn pos() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
let (x, y) = cursor.pos();
}
pub fn move_up() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
cursor.move_up(10);
}
pub fn move_right() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
cursor.move_right(3);
}
pub fn move_down() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
cursor.move_down(3);
}
pub fn move_left() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
cursor.move_left(3);
}
pub fn safe_and_reset_position() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
cursor.goto(5, 5);
cursor.save_position();
cursor.goto(5, 20);
println!("Yea!");
cursor.reset_position();
println!("Back");
println!()
}
pub fn hide_cursor() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
cursor.hide();
}
pub fn show_cursor() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
cursor.show();
}
pub fn blink_cursor() {
let screen = Screen::default();
let mut cursor = cursor(&screen);
cursor.blink(false);
cursor.blink(false);
}