keyboard_query/lib.rs
1#[cfg(target_os = "linux")]
2mod linux;
3#[cfg(target_os = "linux")]
4pub use linux::DeviceState;
5
6#[cfg(target_os = "windows")]
7mod windows;
8#[cfg(target_os = "windows")]
9pub use windows::DeviceState;
10
11#[cfg(target_os = "macos")]
12mod macos;
13#[cfg(target_os = "macos")]
14pub use macos::DeviceState;
15
16pub trait DeviceQuery {
17 fn get_keys(&self) -> Vec<u16>;
18}
19
20impl DeviceQuery for DeviceState {
21 fn get_keys(&self) -> Vec<u16> {
22 self.query_keymap()
23 }
24}