ui_send_keys
Send keyboard input to UI elements with modifier keys (Ctrl, Alt, Shift) and special keys. Target by AutomationId, Name, or control type.
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}
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
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | ||
| automation_id | No | ||
| name | No | ||
| control_type | No | ||
| root_id | No | ||
| xpath | No |