browser_press_key
Press keyboard keys on web pages to submit forms, close modals, navigate menus, or trigger shortcuts using standard key values and modifiers.
Instructions
[Disabled] Press a keyboard key on the page. Dispatches trusted (isTrusted: true) keyboard events via Chrome DevTools Protocol Input.dispatchKeyEvent. Named keys (Enter, Escape, etc.) dispatch rawKeyDown + keyUp; printable characters dispatch keyDown + char + keyUp. Common use cases: Enter to submit forms, Escape to close modals/dialogs, Tab to move between fields, arrow keys to navigate custom menus/dropdowns, Ctrl+K or Cmd+K for search. Supports Ctrl and Meta (Cmd) as independent modifiers. Uses standard KeyboardEvent.key values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | Yes | Tab ID of the page to interact with | |
| key | Yes | Key name using standard KeyboardEvent.key values (e.g., "Enter", "Escape", "Tab", "ArrowDown", "a", "1", " ") | |
| selector | No | CSS selector of element to focus before pressing key. If omitted, dispatches to document.activeElement. | |
| modifiers | No | Modifier keys to hold while pressing the key |