/// Function to update the keys of the virtual keypad.
/// We need to update manually the key states within the program
/// itself to be library independent
Function to update the keys of the virtual keypad.
We need to update manually the key states within the program
itself to be library independent
Function to update the keys of the virtual keypad . We need to update manually the key states within the program itself to be library independent
pub fn update_key(&mut self, key: u8, val: bool) -> Result<(), ()> {
        match self.key_states.get(key as usize) {
            Some(_) => {
                self.key_states[key as usize] = val;
                Ok(())
            },
            None => Err(())
        }
    }
pub fn update_key ( & mut self , key : u8 , val : bool ) -> Result < ( ) , ( ) > { match self . key_states . get ( key as usize ) { Some ( _ ) => { self . key_states [ key as usize ] = val ; Ok ( ( ) ) } , None => Err ( ( ) ) } }
Function to update the keys of the virtual keypad.
Function to update the keys of the virtual keypad .
&mut self
key
u8
val
bool