pub struct Keyboard { /* private fields */ }Expand description
Keyboard provides low-level keyboard control.
Implementations§
Source§impl Keyboard
impl Keyboard
Sourcepub async fn down(&self, key: &str) -> Result<()>
pub async fn down(&self, key: &str) -> Result<()>
Dispatches a keydown event.
See: https://playwright.dev/docs/api/class-keyboard#keyboard-down
Sourcepub async fn up(&self, key: &str) -> Result<()>
pub async fn up(&self, key: &str) -> Result<()>
Dispatches a keyup event.
See: https://playwright.dev/docs/api/class-keyboard#keyboard-up
Sourcepub async fn press(
&self,
key: &str,
options: Option<KeyboardOptions>,
) -> Result<()>
pub async fn press( &self, key: &str, options: Option<KeyboardOptions>, ) -> Result<()>
Executes a complete key press (down + up sequence).
See: https://playwright.dev/docs/api/class-keyboard#keyboard-press
Sourcepub async fn type_text(
&self,
text: &str,
options: Option<KeyboardOptions>,
) -> Result<()>
pub async fn type_text( &self, text: &str, options: Option<KeyboardOptions>, ) -> Result<()>
Sends a keydown, keypress/input, and keyup event for each character.
See: https://playwright.dev/docs/api/class-keyboard#keyboard-type
Sourcepub async fn insert_text(&self, text: &str) -> Result<()>
pub async fn insert_text(&self, text: &str) -> Result<()>
Dispatches only input event, does not emit keydown, keyup or keypress events.
See: https://playwright.dev/docs/api/class-keyboard#keyboard-insert-text
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Keyboard
impl !RefUnwindSafe for Keyboard
impl Send for Keyboard
impl Sync for Keyboard
impl Unpin for Keyboard
impl UnsafeUnpin for Keyboard
impl !UnwindSafe for Keyboard
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