press_key
Send keyboard press events to the browser, supporting modifiers (Alt, Ctrl, Meta, Shift) and special keys for shortcuts and text input, with correct modifier handling.
Instructions
press_key("Enter") / press_key("a") — 修饰键位: Alt=1 Ctrl=2 Meta=4 Shift=8。
tab 不传打当前活动标签。
特殊键(Enter/Tab/Arrow*/Backspace…)带 virtual key code,监听 e.keyCode/e.which/e.key
的页面(表单、老站)都能触发;单字符可打印键补发 char 事件(直接进 input,不走 insertText);
Alt/Ctrl/Meta 修饰时不发 char(让 Ctrl+A 走快捷键而非打出字符 'a')。
移植 browser-harness press_key。
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 | ||
| tab | No | ||
| modifiers | No |