pub trait ScancodeSet {
    fn advance_state(state: DecodeState, code: u8) -> Result<ConsumeState, Error>;
    fn map_scancode(code: u8) -> Result<KeyCode, Error>;
    fn map_extended_scancode(code: u8) -> Result<KeyCode, Error>;
}

Required Methods

Handles state logic based on the byte. ConsumeState::Consume(state) indicates that the byte is now consumed and there may or may not be a new state.

ConsumeState::Proceed(state) indicates that the byte should be passed to the map methods, and there may or may not be a new state.

Convert a Scan Code set X byte to our ‘KeyCode’ enum

Convert a Scan Code Set X extended byte (prefixed E0) to our KeyCode enum.

Implementors