[][src]Struct sunrise_libuser::ps2::Keyboard

pub struct Keyboard {
    inner: InnerKeyboard,
    readable_event: ReadableEvent,
}

A managed keyboard.

Fields

inner: InnerKeyboard

Inner state

readable_event: ReadableEvent

An event triggered on keyboard update.

Implementations

impl Keyboard[src]

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

Creates a keyboard by connecting to the ipc service.

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

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

pub fn read_keystate_async<'a>(
    &'a mut self,
    queue: WorkQueue
) -> impl Future<Output = HidKeyboardState> + Unpin + 'a
[src]

Asynchronously waits for a single keystate change, and return the raw change.

pub fn read_key_async<'a>(
    &'a mut self,
    queue: WorkQueue
) -> impl Future<Output = char> + Unpin + 'a
[src]

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

pub fn try_read_key(&mut 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.

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

If a keystate change is pending, return the raw keystate. This can be used to implement poll-based or asynchronous reading from keyboard.

Trait Implementations

impl Debug for Keyboard[src]

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> 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.