Press key
press_keySend key presses and keyboard shortcuts to the focused page element. Trigger actions like Enter, Tab, Escape, or Control+A after clicking or filling the target.
Instructions
Send a key press or keyboard shortcut to the page.
Goes to whatever currently holds focus, so click or fill the target element first — with nothing focused the key lands on the document body.
Modifiers are held around the main key with the proper modifier bitmask, so real chords such as Control+A or Control+Shift+R register as shortcuts instead of arriving as unrelated key presses.
For entering text use fill (replaces the field) or type_text (appends to it); this tool is for single keys and shortcuts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | A key or chord, e.g. "Enter", "Tab", "Escape", "ArrowDown", "a", "Control+A" or "Control+Shift+R". Modifiers are Control, Shift, Alt and Meta, joined with +. Named keys: Enter, Tab, Backspace, Delete, Escape, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, End, PageUp, PageDown, Space. Any single character works as itself. | |
| include_snapshot | No | Append a fresh page snapshot to the response. Worth it when this action changes the page and take_snapshot would be your next call anyway — it saves a round trip, at the cost of a much larger response. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |