cua_keyboard
Send virtual keyboard input to any macOS or Windows app to type text, press keys, or trigger hotkeys without stealing focus or altering the clipboard.
Instructions
Zero-conflict Virtual Keyboard v2.2 for ANY macOS or Windows software. Defaults to input_mode='virtual' (direct background Unicode/CJK injection via macOS postToPid / Windows PostMessage WM_CHAR without clobbering the user's clipboard or stealing focus!). Supports type_text, key_press, hotkey, key_down, key_up, key_hold, and full Numpad keys.
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": {
"action": "<action>"
},
"name": "cua_keyboard"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | ||
| pid | No | ||
| hwnd | No | ||
| text | No | ||
| action | Yes | ||
| app_name | No | Optional target app name for virtual keyboard routing. | |
| modifiers | No | ||
| input_mode | No | 'virtual' (default, zero conflict & zero clipboard clobbering), 'saved_restore', or 'physical'. | virtual |
| duration_ms | No | ||
| use_clipboard_paste | No |