webview_keyboard
Send keyboard events or type text into Tauri app UI elements using CSS, XPath, or text selectors.
Instructions
[Tauri Apps Only] Type text or send keyboard events in a Tauri app. The selector parameter (for "type" action) supports CSS selectors (default), XPath, and text content matching via the strategy parameter. Requires active driver_session. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app. For browser keyboard input, use Chrome DevTools MCP instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| windowId | No | Window label to target (defaults to "main") | |
| appIdentifier | No | App port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected. | |
| action | Yes | Keyboard action type: "type" for typing text into an element, "press/down/up" for key events | |
| selector | No | Element selector for element to type into (required for "type" action): CSS selector (default), XPath, text content, or ref ID | |
| strategy | No | Selector strategy: "css" (default) for CSS selectors, "xpath" for XPath expressions, "text" to find elements by text content, with fallback to placeholder, aria-label, and title attributes. Ref IDs (e.g., "ref=e3") work with any strategy. | css |
| text | No | Text to type (required for "type" action) | |
| key | No | Key to press (required for "press/down/up" actions, e.g., "Enter", "a", "Escape") | |
| modifiers | No | Modifier keys to hold |