1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
pub trait Mouse {
    fn key_press(&self, button: MouseButton) -> bool;

    fn key_release(&self, button: MouseButton) -> bool;

    fn move_to(&self, x: u16, y: u16, display_index: Option<usize>) -> bool;

    fn get_position(&self) -> MousePosition;
}

#[derive(Debug, Copy, Clone)]
pub enum MouseButton {
    Left,
    Right,
    Middle,
}

#[derive(Debug, Copy, Clone)]
pub struct MousePosition {
    pub display_index: usize,
    pub x: u16,
    pub y: u16,
}