Skip to content

Commit

Permalink
Merge pull request #464 from beyarkay/patch-2
Browse files Browse the repository at this point in the history
[docs] Add links for `Tab.press_key`
  • Loading branch information
mdrokz committed Feb 26, 2024
2 parents a96db60 + 46de11b commit d53405b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/browser/tab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,10 @@ impl Tab {
Ok(self)
}

/// Press a key on the keyboard, optionally with some modifier keys.
/// See [this file](https://github.com/puppeteer/puppeteer/blob/62da2366c65b335751896afbb0206f23c61436f1/lib/USKeyboardLayout.js)
/// for a full definition of which strings correspond with which
/// keys.
pub fn press_key_with_modifiers(
&self,
key: &str,
Expand Down Expand Up @@ -947,6 +951,9 @@ impl Tab {
Ok(self)
}

/// Press a key on the keyboard. See [this file](https://github.com/puppeteer/puppeteer/blob/62da2366c65b335751896afbb0206f23c61436f1/lib/USKeyboardLayout.js)
/// for a full definition of which strings correspond with which
/// keys.
pub fn press_key(&self, key: &str) -> Result<&Self> {
self.press_key_with_modifiers(key, None)
}
Expand Down

0 comments on commit d53405b

Please sign in to comment.