ui_send_keys
Sends keyboard input to a UI element in .NET applications. Supports modifier keys, special keys, and fallback to element search for reliable automation.
Instructions
Send keyboard input to a UI element.
Note: If app is STOPPED at breakpoint, resume with continue_execution() first.
Tries cached coordinates first (click to focus, then send keys), then falls back to pywinauto element search.
Key syntax (modifiers are PREFIX characters, special keys in braces):
Regular text: "hello world"
Modifiers: ^ = Ctrl, % = Alt, + = Shift
Alt+Z: "%z" Alt+F4: "%{F4}"
Ctrl+C: "^c" Ctrl+Shift+S: "^+s"
Shift+Tab: "+{TAB}"
Special keys: {ENTER} {TAB} {ESC} {DELETE} {BACKSPACE}
Arrow keys: {LEFT} {RIGHT} {UP} {DOWN}
Navigation: {HOME} {END} {PGUP} {PGDN}
Function keys: {F1} {F2} ... {F12}
Physical keypad: {NUMPAD0} ... {NUMPAD9}, {NUMPADADD}, {NUMPADSUBTRACT}, {NUMPADMULTIPLY}, {NUMPADDIVIDE}, {NUMPADDECIMAL}, {NUMPADENTER}, {NUMLOCK} (press/release, not lock-state setting)
Combined: Ctrl+End = "^{END}", Alt+Z = "%z"
IMPORTANT: Modifier prefixes (^%+) apply to the NEXT character or {KEY}. For Alt+Z send "%z" (NOT "{ALT}z" or "Alt+Z").
Args: keys: Keys to send (see syntax above) automation_id: Target element's AutomationId name: Target element's Name control_type: Target element's control type
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": "ui_send_keys"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | ||
| name | No | ||
| xpath | No | ||
| root_id | No | ||
| control_type | No | ||
| automation_id | No |