[][src]Struct sunrise_keyboard::Keyboard

struct Keyboard {
    writable_event: Option<WritableEvent>,
    readable_event: ReadableEvent,
    keys_queue: VecDeque<HidKeyboardState>,
}

Keyboard handling structure.

Fields

writable_event: Option<WritableEvent>

The event used to signal changes in the shared memory.

readable_event: ReadableEvent

The event returned to the client when requested via IPC.

keys_queue: VecDeque<HidKeyboardState>

The queue containing the keyboard state received by the driver.

Implementations

impl Keyboard[src]

pub fn new() -> Result<Self, Error>[src]

Create a new instance of Keyboard.

pub fn get_readable_event(&self) -> HandleRef<'static>[src]

Get the readable update event of the Keyboard.

pub fn take_writable_event(&mut self) -> Option<WritableEvent>[src]

Get the writeable update event of the Keyboard.

Note:

This consume the internal writable_event.q

pub fn handle_ps2_irq(&mut self) -> Option<()>[src]

Handle a PS2 IRQ and push a new key state to the internal queue if needed.

pub fn read_keyboard_states(
    &mut self,
    states: &mut [HidKeyboardState]
) -> Result<u64, Error>
[src]

Get the last key states on the internal queue.

Auto Trait Implementations

impl RefUnwindSafe for Keyboard

impl Send for Keyboard

impl Sync for Keyboard

impl Unpin for Keyboard

impl UnwindSafe for Keyboard

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.