use super::Mods;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Platform {
Mac,
Windows,
Linux,
}
impl Platform {
pub const fn current() -> Self {
if cfg!(target_os = "macos") {
Self::Mac
} else if cfg!(windows) {
Self::Windows
} else {
Self::Linux
}
}
pub const fn primary(self) -> Mods {
match self {
Self::Mac => Mods::META,
Self::Windows | Self::Linux => Mods::CTRL,
}
}
}
impl Default for Platform {
fn default() -> Self {
Self::current()
}
}