browser_press_key
Presses keyboard keys at the current focus to close dialogs, tab between fields, select suggestions, undo edits, or move the caret before typing text; not for entering text.
Instructions
Press keys, in order, where focus is: Escape closes a dialog on the page, Tab moves to the next field, ArrowDown/Enter pick from a suggestion list, End or arrows move the caret before browser_input_text without emsn types there, Control+Z undoes. Not for typing text. Refused, nothing pressed: copy/cut/paste, and the browser's own shortcuts (use browser_close_tab, browser_reload and so on). Replies once the page has handled the last key; it does not say what the keys did, so snapshot to see. A list highlighted under the pointer counts arrows from that item, which a snapshot does not show: to pick a given item, click it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emsn | No | Focus this element first: clicked unless focus is already in it, so a button or link acts and a field's caret moves to the click. Leave out to press where focus is. | |
| keys | Yes | At most 100 presses in all. | |
| tabId | No | Tab to act on. Defaults to the foreground tab of that window. | |
| windowId | No | Window to act on. Defaults to the frontmost window. | |
| snapshotId | Yes | The snapshotId from the browser_take_snapshot you picked the emsn out of. An element keeps its emsn while the page stays (no navigation or reload), so with an emsn any snapshot of the current page is accepted; with x,y only the latest one is. A number whose element has gone is refused rather than clicked. | |
| repeatDelayMs | No | Pause between presses, default 80. |