device_query/
mouse_state.rs

1//! Description of mouse coordinates and state of buttons.
2
3/// Mouse position.
4pub type MousePosition = (i32, i32);
5
6/// MouseButton.
7pub type MouseButton = usize;
8
9#[derive(Debug, PartialEq, Default, Clone)]
10/// A simple structure containing the current mouse coordinates and the
11/// state of each mouse button that we can query. Currently, Windows and
12/// Linux provide nice ways to query five mouse buttons. Since button
13/// numbers are 1-based, `button_pressed[0]` is assumed to be false and
14/// have no meaning.
15pub struct MouseState {
16    /// Coordinates in pixel.
17    pub coords: MousePosition,
18    /// State of each mouse button.
19    pub button_pressed: Vec<bool>,
20}