pub struct Keyboard<'a> { /* private fields */ }Expand description
Keyboard operations. Obtain via InputSim::keyboard.
Implementations§
Source§impl Keyboard<'_>
impl Keyboard<'_>
Sourcepub fn chord(&self, key: Key, held: &[Key]) -> Result<()>
pub fn chord(&self, key: Key, held: &[Key]) -> Result<()>
Tap key while held are held down.
Modifiers are ordinary keys in this API — pass Key::Shift,
Key::Ctrl, Key::Alt, or Key::Meta via held.
ⓘ
// Cmd/Ctrl+A:
keyboard.chord(Key::Char('a'), &[Key::Meta])?;Sourcepub fn type_text(&self, text: &str) -> Result<()>
pub fn type_text(&self, text: &str) -> Result<()>
Type literal text into whichever element currently has keyboard focus.
Keyboard does not focus the target for you — call the appropriate
accessibility action (e.g. Element::focus via the provider) first.
Unlike press, this accepts any text (including
uppercase and shifted symbols); backends handle the case/shift synthesis.
Auto Trait Implementations§
impl<'a> Freeze for Keyboard<'a>
impl<'a> !RefUnwindSafe for Keyboard<'a>
impl<'a> Send for Keyboard<'a>
impl<'a> Sync for Keyboard<'a>
impl<'a> Unpin for Keyboard<'a>
impl<'a> UnsafeUnpin for Keyboard<'a>
impl<'a> !UnwindSafe for Keyboard<'a>
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