press_keys
Sends single keys or keyboard chords to a specified Windows window, using background input by default and guarded focus handling for targeted automation.
Instructions
Press a key or chord. Requires hwnd/title_contains unless allow_global=True.
Single keys default to background WM_KEYDOWN/WM_KEYUP; chords use guarded SendInput with focus restore.
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": {
"keys": "<keys>"
},
"name": "press_keys"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hwnd | No | ||
| keys | Yes | ||
| mode | No | background | |
| focus | No | ||
| allow_global | No | ||
| user_idle_ms | No | ||
| restore_focus | No | ||
| title_contains | No | ||
| respect_user_input | No | ||
| require_target_focus | No | ||
| wait_for_idle_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |