ghost_key
Send keystrokes to a window without bringing it to focus, using a title substring or the session anchor for targeting. Supports single keys and editing shortcuts like Ctrl+C.
Instructions
Send a key to a window WITHOUT focusing it. Target = window= (anchored) or the session anchor. Under the default background policy the key is POSTED to the window's focused control: single keys (Enter, Tab, F5, arrows, any character) and the editing shortcuts Ctrl+C/X/V/A/Z (sent as semantic messages). Other modifier combos have no background path and error naming the alternative. For text prefer ghost_act action=type (read-back verified). Hold/release keys='down:Shift' / 'up:Shift' exist only under a foreground policy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | Key spec: 'Enter', 'a', 'Ctrl+C', 'down:Shift', 'up:Shift' | |
| window | No | Title substring of the window to send to (anchors it). Omit to use the anchor. With no anchor at all the key goes to the human's foreground window and the response says so. | |
| background | No | Compatibility flag: background posting is already the default. |