pub trait InputDevice {
// Required methods
fn media_buttons(
&mut self,
pressed_buttons: Vec<MediaButton>,
time: u64,
) -> Result<(), Error>;
fn key_press(
&mut self,
keyboard: KeyboardReport,
time: u64,
) -> Result<(), Error>;
fn key_press_raw(
&mut self,
keyboard: KeyboardReport,
time: u64,
) -> Result<(), Error>;
fn key_press_usage(
&mut self,
usage: Option<u32>,
time: u64,
) -> Result<(), Error>;
fn tap(&mut self, pos: Option<(u32, u32)>, time: u64) -> Result<(), Error>;
fn multi_finger_tap(
&mut self,
fingers: Option<Vec<Touch>>,
time: u64,
) -> Result<(), Error>;
fn mouse(
&mut self,
report: MouseInputReport,
time: u64,
) -> Result<(), Error>;
fn flush<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>
where Self: 'async_trait;
}
Required Methods§
Sends a media buttons report with the specified buttons pressed.
Sourcefn key_press(
&mut self,
keyboard: KeyboardReport,
time: u64,
) -> Result<(), Error>
fn key_press( &mut self, keyboard: KeyboardReport, time: u64, ) -> Result<(), Error>
Sends a keyboard report with keys defined mostly in terms of USB HID usage page 7. This is sufficient for keyboard keys, but does not cover the full extent of keys that Fuchsia supports. As result, the KeyboardReport is converted internally into Fuchsia’s encoding before being forwarded.
Sourcefn key_press_raw(
&mut self,
keyboard: KeyboardReport,
time: u64,
) -> Result<(), Error>
fn key_press_raw( &mut self, keyboard: KeyboardReport, time: u64, ) -> Result<(), Error>
Sends a keyboard report using the whole range of key codes. Key codes provided
are not modified or mapped in any way.
This differs from key_press
, which performs special mapping for key codes
from USB HID Page 0x7.
fn key_press_usage( &mut self, usage: Option<u32>, time: u64, ) -> Result<(), Error>
fn tap(&mut self, pos: Option<(u32, u32)>, time: u64) -> Result<(), Error>
fn multi_finger_tap( &mut self, fingers: Option<Vec<Touch>>, time: u64, ) -> Result<(), Error>
Sourcefn mouse(&mut self, report: MouseInputReport, time: u64) -> Result<(), Error>
fn mouse(&mut self, report: MouseInputReport, time: u64) -> Result<(), Error>
Sends a mouse report with the specified relative cursor movement and buttons pressed.