KeyCodeMapper

Trait KeyCodeMapper 

Source
pub trait KeyCodeMapper {
    // Required methods
    fn to_code(&self, platform: Platform) -> usize;
    fn from_code(code: usize, platform: Platform) -> Option<Self>
       where Self: Sized;
}
Expand description

Trait for types that can be converted to and from platform-specific key codes

Required Methods§

Source

fn to_code(&self, platform: Platform) -> usize

Convert the key or modifier to a platform-specific code

Source

fn from_code(code: usize, platform: Platform) -> Option<Self>
where Self: Sized,

Parse a key or modifier from a platform-specific code

Implementors§