/// This function will decode the key into an abstract xkb representation (Keysym).
/// The keycode will be increased by 8 because the evdev XKB rules reflect X's
/// broken keycode system, which starts at 8
This function will decode the key into an abstract xkb representation (Keysym).
The keycode will be increased by 8 because the evdev XKB rules reflect X's
broken keycode system, which starts at 8
This function will decode the key into an abstract xkb representation ( Keysym ) . The keycode will be increased by 8 because the evdev XKB rules reflect X ' s broken keycode system which starts at 8
pub fn decode(&mut self, keycode: u32) -> Keystrokes {
        let direction = match self
            .keystroke_stack
            .iter()
            .rposition(|element| element == &keycode)
        {
            Some(index) => {
                self.keystroke_stack.remove(index);
                KeyDirection::Up
            }
            None => {
                self.keystroke_stack.push(keycode);
                KeyDirection::Down
            }
        };
        let keycode = keycode + 8;
        self.state.update_key(
            keycode,
            match direction {
                KeyDirection::Up => KeyDirection::Up,
                KeyDirection::Down => KeyDirection::Down,
            },
        );
        Keystrokes {
            state: &self.state,
            keycode,
            direction,
        }
    }
pub fn decode ( & mut self , keycode : u32 ) -> Keystrokes { let direction = match self . keystroke_stack . iter ( ) . rposition ( | element | element == & keycode ) { Some ( index ) => { self . keystroke_stack . remove ( index ) ; KeyDirection :: Up } None => { self . keystroke_stack . push ( keycode ) ; KeyDirection :: Down } } ; let keycode = keycode + 8 ; self . state . update_key ( keycode , match direction { KeyDirection :: Up => KeyDirection :: Up , KeyDirection :: Down => KeyDirection :: Down , } , ) ; Keystrokes { state : & self . state , keycode , direction , } }
This function will decode the key into an abstract xkb representation (Keysym).
This function will decode the key into an abstract xkb representation ( Keysym ) .
&mut self
keycode
u32