pub struct Mouse { /* private fields */ }
Expand description
A basic interface to interact with a PS2 mouse.
Implementations§
Source§impl Mouse
impl Mouse
Sourcepub fn get_state(&self) -> MouseState
pub fn get_state(&self) -> MouseState
Returns the last completed state of the mouse.
Sourcepub fn init(&mut self) -> Result<(), &'static str>
pub fn init(&mut self) -> Result<(), &'static str>
Attempts to initialize a Mouse
. If successful, interrupts will be generated
as PIC offset + 12
.
Sourcepub fn process_packet(&mut self, packet: u8)
pub fn process_packet(&mut self, packet: u8)
Attempts to process a packet.
Sourcepub fn set_on_complete(&mut self, handler: fn(MouseState))
pub fn set_on_complete(&mut self, handler: fn(MouseState))
Sets the on_complete
function to be called when a packet is completed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mouse
impl RefUnwindSafe for Mouse
impl Send for Mouse
impl Sync for Mouse
impl Unpin for Mouse
impl UnwindSafe for Mouse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more