use std::fmt::Display;
#[derive(Debug)]
pub enum ModifierKey {
Alt,
AltGraph,
CapsLock,
Control,
Fn,
FnLock,
Hyper,
Meta,
NumLock,
ScollLock,
Shift,
Super,
Symbol,
SymbolLock,
}
impl ModifierKey {
pub fn as_str(&self) -> &'static str {
match self {
Self::Alt => "Alt",
Self::AltGraph => "AltGraph",
Self::CapsLock => "CapsLock",
Self::Control => "Control",
Self::Fn => "Fn",
Self::FnLock => "FnLock",
Self::Hyper => "Hyper",
Self::Meta => "Meta",
Self::NumLock => "NumLock",
Self::ScollLock => "ScrollLock",
Self::Shift => "Shift",
Self::Super => "Super",
Self::Symbol => "Symbol",
Self::SymbolLock => "SymbolLock",
}
}
}
impl Display for ModifierKey {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.as_str())
}
}