#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub struct PointerId(pub u64);
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub enum Button {
Left,
Middle,
Right,
Other(u64)
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub enum PointerAction {
Enter,
Leave,
Move,
ButtonDown,
Drag,
ButtonUp,
Cancel
}
#[derive(Clone, PartialEq, Debug)]
pub struct PointerState {
pub location_in_window: (f64, f64),
pub location_in_canvas: Option<(f64, f64)>,
pub buttons: Vec<Button>,
pub pressure: Option<f64>,
pub tilt: Option<(f64, f64)>,
pub rotation: Option<f64>,
pub flow_rate: Option<f64>
}
impl PointerState {
pub fn new() -> PointerState {
PointerState {
location_in_window: (0.0, 0.0),
location_in_canvas: None,
buttons: vec![],
pressure: None,
tilt: None,
rotation: None,
flow_rate: None
}
}
}