[][src]Trait pc_keyboard::ScancodeSet

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

impl ScancodeSet for ScancodeSet1
[src]

Implements state logic for scancode set 1

Implements the single byte codes for Set 1.

Implements the extended byte codes for set 1 (prefixed with E0)

impl ScancodeSet for ScancodeSet2
[src]

Implements state logic for scancode set 2

Implements the single byte codes for Set 2.

Implements the extended byte codes for set 1 (prefixed with E0)