33 lines
731 B
Rust
33 lines
731 B
Rust
#[cfg(target_os = "windows")]
|
|
mod windows;
|
|
#[cfg(target_os = "windows")]
|
|
pub use crate::windows::*;
|
|
|
|
use crate::keyboard::Key;
|
|
use crate::mouse::Button;
|
|
use std::time::SystemTime;
|
|
|
|
pub mod keyboard;
|
|
pub mod mouse;
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq)]
|
|
#[cfg_attr(feature = "with_serde", derive(serde::Serialize, serde::Deserialize))]
|
|
pub enum EventType {
|
|
KeyPress(Key),
|
|
KeyRelease(Key),
|
|
MousePress(Button),
|
|
MouseRelease(Button),
|
|
MouseMoveTo { x: f64, y: f64 },
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
#[cfg_attr(feature = "with_serde", derive(serde::Serialize, serde::Deserialize))]
|
|
pub struct Event {
|
|
pub time: SystemTime,
|
|
pub event_type: EventType,
|
|
}
|
|
|
|
pub type HookCallback = fn(event: Event);
|
|
|
|
pub struct Robot;
|