/// Returns corresponding key `Input` based on a key code
///
/// # Arguments
///
/// * `in_code` - A u8 which is the unique key code
///
/// # Examples
///
/// ```
/// use os::input::Input;
/// let a_key = Input::key_from_code(0x41);
/// ```
///
/// # Todo
///
/// * `(Speed)` - Use lookup table to speed up find.
Returns corresponding key `Input` based on a key code
Returns corresponding key ` Input ` based on a key code
pub fn key_from_code(in_code: u8) -> Option<Self> {
        for input in ALL_INPUTS.iter() {
            match input.variant {
                InputVariant::Key { code, symbol: _ } => {
                    if in_code == code {
                        return Some(*input);
                    }
                }
                _ => {}
            }
        }
        None
    }
pub fn key_from_code ( in_code : u8 ) -> Option < Self > { for input in ALL_INPUTS . iter ( ) { match input . variant { InputVariant :: Key { code , symbol : _ } => { if in_code == code { return Some ( * input ) ; } } _ => { } } } None }
Returns corresponding key `Input` based on a key code
Returns corresponding key ` Input ` based on a key code
in_code
u8
examples
None
todo
`(Speed)` - Use lookup table to speed up find.
` ( Speed ) ` - Use lookup table to speed up find .