[][src]Struct sunrise_keyboard::ps2::PRIMARY_PS2

struct PRIMARY_PS2 {
    __private_field: (),
}

Primary PS2 controller instance on a classical IBM/PC architecture.

Fields

__private_field: ()

Methods from Deref<Target = PS2>

fn handle_control_key(&self, key: HidKeyboardScancode, state: State)[src]

Handle a control key scancode

fn key_to_letter(&self, key: LetterKey) -> char[src]

Gets the letter from the key, accounting for shift and capslock

fn encode_modifiers(&self, state: State) -> u8[src]

Get a bitfield representing the modifiers of this keyboard

fn has_read_key_event(&self) -> bool[src]

Return true if the PS2 keyboard has an key event to read.

fn try_read_key_event(&self) -> Option<KeyEvent>[src]

Tries to read a KeyEvent, grabs more bytes from the port if input is incomplete.

Core function used by both try_read_keyboard_state and try_read_key

fn try_read_keyboard_state(&self) -> Option<HidKeyboardState>[src]

Return a representation of a single key press if any updates is availaible.

Key presses are bufferized: if nobody is calling read_key when the user presses a key, it will be kept in a buffer until read_key is called.

fn read_key(&self) -> char[src]

Waits for a single key press, and return its unicode representation.

Key presses are bufferized: if nobody is calling read_key when the user presses a key, it will be kept in a buffer until read_key is called.

fn try_read_key(&self) -> Option<char>[src]

If a key press is pending, return its unicode representation. This can be used to implement poll-based or asynchronous reading from keyboard.

fn event_irq(&self) -> &ReadableEvent[src]

Get a ReadableEvent for the PS2 IRQ. Waiting on this event will wait until a keypress is detected. Note that once this event is triggered, it won't trigger again until read_key or try_read_key is called.

Trait Implementations

impl Deref for PRIMARY_PS2[src]

type Target = PS2

The resulting type after dereferencing.

impl LazyStatic for PRIMARY_PS2[src]

Auto Trait Implementations

impl RefUnwindSafe for PRIMARY_PS2

impl Send for PRIMARY_PS2

impl Sync for PRIMARY_PS2

impl Unpin for PRIMARY_PS2

impl UnwindSafe for PRIMARY_PS2

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SizedIPCBuffer for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.