type_text
Simulate keyboard input to type text into applications with configurable keystroke delay for automation workflows.
Instructions
Type text as if from a keyboard.
Args: text: The text to type delay_ms: Delay between keystrokes in milliseconds (0 = instant)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| delay_ms | No |
Implementation Reference
- hyprland_mcp/input.py:116-132 (handler)The handler implementation for type_text which uses wtype to simulate keyboard input.
async def type_text(text: str, delay_ms: int = 0) -> None: """Type text using wtype.""" require_tool("wtype") cmd = ["wtype"] if delay_ms > 0: cmd.extend(["-d", str(delay_ms)]) cmd.extend(["--", text]) proc = await asyncio.create_subprocess_exec( *cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, ) _, stderr = await proc.communicate() if proc.returncode != 0: raise InputError(f"wtype failed: {stderr.decode().strip()}")