press_key
Simulates real keyboard input to press a key or shortcut on a selected or focused browser element and returns the resulting changes.
Instructions
Press a key or combination with real keyboard input on selector (focused first) or the focused element. Returns changes.
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 | A character or key name (Enter, Tab, Escape, ArrowDown, PageUp, F5, ...); join modifiers with +, e.g. Shift+Tab, Meta+a. | |
| selector | No | Locator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b | |
| sessionId | No | ||
| timeoutMs | No | ms to retry while the element is missing (default 2000). |