[−][src]Struct sunrise_keyboard::ps2::PS2
PS2 keyboard state.
Fields
status_port: Pio<u8>
Status Register address
data_port: Pio<u8>
Data Register address
event: ReadableEvent
IRQEvent for the PS/2 keyboard. Triggered each time the user presses a key.
is_capslocked: AtomicBool
Flips when the user has toggled the caps lock key. When set to true, all letters are returned in uppercase.
is_left_shift: AtomicBool
Set to true if the user is currently holding the left shift key. When set to true, all letters are returned in uppercase.
is_right_shift: AtomicBool
Set to true if the user is currently holding the right shift key. When set to true, all letters are returned in uppercase.
is_left_ctrl: AtomicBool
Set to true if the user is currently holding the left ctrl key.
is_right_ctrl: AtomicBool
Set to true if the user is currently holding the right ctrl key.
is_left_alt: AtomicBool
Set to true if the user is currently holding the left alt key.
is_right_alt: AtomicBool
Set to true if the user is currently holding the right alt key.
partial_input: RwLock<ArrayVec<[u8; 6]>>
Holds input until sequence has been completed.
Implementations
impl PS2
[src]
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.
Auto Trait Implementations
impl !RefUnwindSafe for PS2
impl Send for PS2
impl Sync for PS2
impl Unpin for PS2
impl UnwindSafe for PS2
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SizedIPCBuffer for T
[src]
fn size(&self) -> usize
[src]
fn is_cool(addr: usize, size: usize) -> bool
[src]
unsafe fn from_raw_parts<'a>(addr: usize, _size: usize) -> &'a T
[src]
unsafe fn from_raw_parts_mut<'a>(addr: usize, _size: usize) -> &'a mut T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,