key_type
Send keystrokes or type literal text to the currently focused window using PowerShell SendKeys. Handles shortcuts like Ctrl+C, Enter, and Alt+F4 for automation.
Instructions
Type text or send keystrokes to the currently focused window using PowerShell SendKeys. Call window_focus first to make sure the target window is active. For literal text, pass 'text' (special characters are escaped automatically). For shortcuts and special keys, pass 'keys' as a raw SendKeys string: ^c (Ctrl+C), ^v (Ctrl+V), {ENTER}, {TAB}, {ESC}, {BACKSPACE}, {DEL}, {UP}, {DOWN}, {LEFT}, {RIGHT}, {F1}..{F12}, %{F4} (Alt+F4). Example: keys="^s" saves the focused file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | No | Raw SendKeys string for shortcuts/special keys. Example: "^s" (Ctrl+S), "{ENTER}", "%%{F4}" (Alt+F4). Takes precedence over text. | |
| text | No | Literal text to type, escaped automatically. Example: "Hello world" or "npm install" | |
| delay_ms | No | Delay between characters in milliseconds (only applies to 'text'). Default: 0. Use 50-100 for slow, stable typing. |