browser_press_key
Press a keyboard key (Enter, Tab, Escape, ArrowDown, etc.). Useful for submitting forms, navigating dropdowns, closing dialogs. Supports modifier keys (ctrl, alt, shift, meta). While ctrl, meta or alt is held, no character is typed.
Instructions
Press a keyboard key (Enter, Tab, Escape, ArrowDown, etc.). Useful for submitting forms, navigating dropdowns, closing dialogs. Supports modifier keys (ctrl, alt, shift, meta). While ctrl, meta or alt is held, no character is typed. With ctrl or meta (and no shift), the letters a, c, x, v, z and y are sent with Chrome's own editing command - select all, copy, cut, paste, undo, redo; z with shift is redo - including on macOS, where Chrome runs no shortcut for a synthetic key without it. The answer names the command that was sent in shortcut; landed says the page received the key, not what the command did. Paste inserts the user's real clipboard into the page, and copy and cut replace what is on it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | Hold Alt key | |
| key | Yes | Key to press: "Enter", "Tab", "Escape", "ArrowDown", "ArrowUp", "Backspace", "a", "1", etc. | |
| code | No | Key code (optional, defaults to key name). E.g. "KeyA" for "a" | |
| ctrl | No | Hold Ctrl/Cmd key | |
| meta | No | Hold Meta (Cmd on Mac) key | |
| shift | No | Hold Shift key |