[−][src]Struct ps2::Keyboard
A PS/2 keyboard.
This provides the functionality of a typical PS/2 keyboard, as well as PS/2 devices that act like keyboards, such as barcode scanners, card readers, fingerprint scanners, etc.
Examples
use ps2::Controller; let mut controller = unsafe { Controller::new() }; let mut keyboard = controller.keyboard();
Implementations
impl<'c> Keyboard<'c>
[src]
pub fn set_leds(&mut self, leds: KeyboardLedFlags) -> Result<(), KeyboardError>
[src]
Set the state of the keyboard LEDs.
pub fn echo(&mut self) -> Result<(), KeyboardError>
[src]
Run a diagnostic echo command.
pub fn get_scancode_set(&mut self) -> Result<u8, KeyboardError>
[src]
Get the number corresponding to the current scancode set (1, 2, or 3).
pub fn set_scancode_set(
&mut self,
scancode_set: u8
) -> Result<(), KeyboardError>
[src]
&mut self,
scancode_set: u8
) -> Result<(), KeyboardError>
Set the scancode set number (1, 2, or 3).
pub fn get_keyboard_type(&mut self) -> Result<KeyboardType, KeyboardError>
[src]
Attempt to obtain a device identifier for this keyboard.
pub fn set_typematic_rate_and_delay(
&mut self,
typematic_config: u8
) -> Result<(), KeyboardError>
[src]
&mut self,
typematic_config: u8
) -> Result<(), KeyboardError>
Set the typematic repeat rate and delay.
Use the 'Repeat rate' and 'Delay' tables on this page to create the configuration byte.
pub fn enable_scanning(&mut self) -> Result<(), KeyboardError>
[src]
Clear the data buffer and last typematic key, then enable scancodes.
pub fn disable_scanning(&mut self) -> Result<(), KeyboardError>
[src]
Reset keyboard to power-on state and disable scancodes.
pub fn set_defaults(&mut self) -> Result<(), KeyboardError>
[src]
Reset keyboard to power-on state by clearing the data buffer and restoring all default key settings.
pub fn set_all_keys_typematic(&mut self) -> Result<(), KeyboardError>
[src]
Set all keys to typematic only. This only has an effect if scancode set 3 is in use.
pub fn set_all_keys_make_break(&mut self) -> Result<(), KeyboardError>
[src]
Set all keys to make/break only. This only has an effect if scancode set 3 is in use.
pub fn set_all_keys_make_only(&mut self) -> Result<(), KeyboardError>
[src]
Set all keys to make only. This only has an effect if scancode set 3 is in use.
pub fn set_all_keys_typematic_make_break(&mut self) -> Result<(), KeyboardError>
[src]
Set all keys to typematic and make/break. This only has an effect if scancode set 3 is in use.
pub fn set_key_typematic(&mut self, scancode: u8) -> Result<(), KeyboardError>
[src]
Set a specific key to typematic only. This only has an effect if scancode set 3 is in use.
pub fn set_key_make_break(&mut self, scancode: u8) -> Result<(), KeyboardError>
[src]
Set a specific key to make/break only. This only has an effect if scancode set 3 is in use.
pub fn set_key_make_only(&mut self, scancode: u8) -> Result<(), KeyboardError>
[src]
Set a specific key to make only. This only has an effect if scancode set 3 is in use.
pub fn resend_last_byte(&mut self) -> Result<u8, KeyboardError>
[src]
Get the last byte sent by the keyboard.
pub fn reset_and_self_test(&mut self) -> Result<(), KeyboardError>
[src]
Reset the keyboard and perform a Basic Assurance Test.
Returns KeyboardError::SelfTestFailed
if the test fails.
Trait Implementations
Auto Trait Implementations
impl<'c> Send for Keyboard<'c>
[src]
impl<'c> Sync for Keyboard<'c>
[src]
impl<'c> Unpin for Keyboard<'c>
[src]
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,
pub 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, 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.
pub 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>,