extern crate crossterm_cursor;
use crossterm_cursor::cursor;
use std::io;
pub fn goto() -> io::Result<()> {
let cursor = cursor();
cursor.goto(10, 5)?;
Ok(())
}
pub fn pos() {
let cursor = cursor();
let (x, y) = cursor.pos();
println!("{} {}", x, y);
}
pub fn move_up() {
let mut cursor = cursor();
cursor.move_up(10);
}
pub fn move_right() {
let mut cursor = cursor();
cursor.move_right(3);
}
pub fn move_down() {
let mut cursor = cursor();
cursor.move_down(3);
}
pub fn save_and_reset_position() -> io::Result<()> {
let cursor = cursor();
cursor.goto(5, 5)?;
cursor.save_position()?;
cursor.goto(5, 20)?;
println!("Yea!");
cursor.reset_position()?;
println!("Back");
println!();
Ok(())
}
pub fn hide_cursor() {
let cursor = cursor();
cursor.hide().unwrap();
}
pub fn show_cursor() {
let cursor = cursor();
cursor.show().unwrap();
}
pub fn blink_cursor() {
let cursor = cursor();
cursor.blink(false).unwrap();
cursor.blink(false).unwrap();
}
fn main() {
pos()
}