press_key
Presses a key with optional modifiers in a specified or focused browser element, triggering default actions like Enter submitting or Tab moving focus. Use fill_input for typing text.
Instructions
Presses one key, with modifiers (Control+a, Shift+Tab), as a user would, in the element given (focused first) or the focused one; the browser's default action runs (Enter submits, Tab moves the focus). With Control, Alt or Meta held nothing is typed. To type text use fill_input. A dialog or breakpoint it causes is noted, as for click_element.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"key": "<key>"
},
"name": "press_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | One character or Enter, Tab, Escape, Backspace, Delete, ArrowLeft, ArrowUp, ArrowRight, ArrowDown, Home, End, PageUp, PageDown, Insert, Space, F1-F12; optionally after modifiers joined with '+' (Control+a, Shift+Tab, ControlOrMeta+c: Meta on macOS, else Control). | |
| tab_id | No | Default: the active tab. | |
| selector | No | Element to focus first (CSS, 'host >>> inner' or a snapshot ref). Default: the focused element. | |
| modifiers | No | Keys held while it is pressed. | |
| instance_id | No | Default: 'default'. |