const CSI: &str = "\u{1b}[";
pub fn down(x: u16, y: u16, button: u8) -> String {
format!("{CSI}<{};{};{}M", button, x + 1, y + 1)
}
pub fn up(x: u16, y: u16, button: u8) -> String {
format!("{CSI}<{};{};{}m", button, x + 1, y + 1)
}
pub fn motion(x: u16, y: u16) -> String {
format!("{CSI}<35;{};{}M", x + 1, y + 1)
}
pub fn scroll(x: u16, y: u16, up: bool) -> String {
let code = if up { 64 } else { 65 };
format!("{CSI}<{};{};{}M", code, x + 1, y + 1)
}
pub fn click(x: u16, y: u16, button: u8) -> String {
format!("{}{}", down(x, y, button), up(x, y, button))
}