use crate::types::{Button, Key, MediaKey};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Input {
Button(Button),
Key(Key),
Media(MediaKey),
}
impl From<Button> for Input {
fn from(b: Button) -> Self {
Input::Button(b)
}
}
impl From<Key> for Input {
fn from(k: Key) -> Self {
Input::Key(k)
}
}
impl From<MediaKey> for Input {
fn from(m: MediaKey) -> Self {
Input::Media(m)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Motion {
Cursor { dx: i16, dy: i16 },
Wheel(i16),
}