{"id":"4c4acf3e-cd01-442c-851e-6c133a7c1a01","entityType":"agent","slug":"clawhub-matagul-desktop-control-2","name":"Desktop Control","canonicalUrl":"https://www.xpersona.co/agent/clawhub-matagul-desktop-control-2","canonicalPath":"/agent/clawhub-matagul-desktop-control-2","generatedAt":"2026-10-09T10:00:34.306Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-05-21T06:30:40.139Z","emptyReason":null},"description":"Advanced desktop automation with mouse, keyboard, and screen control Skill: Desktop Control Owner: matagul Summary: Advanced desktop automation with mouse, keyboard, and screen control Tags: latest:1.0.0 Version history: v1.0.0 | 2026-02-05T01:33:20.863Z | auto Version 1.0.0 - Initial release of the Desktop Control skill for OpenClaw. - Provides advanced automation: mouse movement/clicks, keyboard input, hotkeys, and typing speed control. - Supports screen capture, region-based screen","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 54.9K downloads reported by the source. Last updated 5/21/2026.","installCommand":"clawhub skill install publishers:matagul:desktop-control","sourceUrl":"https://clawhub.ai/matagul/desktop-control","homepage":"https://clawhub.ai/matagul/desktop-control","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/matagul/desktop-control","kind":"source"}],"safetyScore":84,"overallRank":62,"popularityScore":94,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Advanced desktop automation with mouse, keyboard, and screen control Skill: Desktop Control Owner: matagul Summary: Advanced desktop automation with mouse, keyb"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-05-21T06:30:40.139Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-05-21T06:30:40.139Z","emptyReason":null},"stars":null,"forks":null,"downloads":54915,"packageName":null,"latestVersion":"1.0.0","tractionLabel":"54.9K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-05-21T06:30:40.104Z","emptyReason":null},"lastUpdatedAt":"2026-05-21T06:30:40.139Z","lastCrawledAt":"2026-05-21T06:30:40.104Z","lastIndexedAt":null,"nextCrawlAt":"2026-05-22T06:30:40.104Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.0","createdAt":"2026-02-05T01:33:20.863Z","changelog":"Version 1.0.0 - Initial release of the Desktop Control skill for OpenClaw. - Provides advanced automation: mouse movement/clicks, keyboard input, hotkeys, and typing speed control. - Supports screen capture, region-based screenshots, image/template matching, and pixel color detection. - Includes window management (list, activate, move, resize, minimize/maximize). - Safety features: failsafe abort, logging, approval mode, bounds checks, and emergency pause. - Detailed documentation with examples and complete API reference.","fileCount":7,"zipByteSize":25093}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install publishers:matagul:desktop-control","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T10:00:34.305Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-matagul-desktop-control-2/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-05-21T06:30:40.139Z","emptyReason":null},"readme":"Skill: Desktop Control\n\nOwner: matagul\n\nSummary: Advanced desktop automation with mouse, keyboard, and screen control\n\nTags: latest:1.0.0\n\nVersion history:\n\nv1.0.0 | 2026-02-05T01:33:20.863Z | auto\n\nVersion 1.0.0\n\n- Initial release of the Desktop Control skill for OpenClaw.\n- Provides advanced automation: mouse movement/clicks, keyboard input, hotkeys, and typing speed control.\n- Supports screen capture, region-based screenshots, image/template matching, and pixel color detection.\n- Includes window management (list, activate, move, resize, minimize/maximize).\n- Safety features: failsafe abort, logging, approval mode, bounds checks, and emergency pause.\n- Detailed documentation with examples and complete API reference.\n\nArchive index:\n\nArchive v1.0.0: 7 files, 25093 bytes\n\nFiles: __init__.py (18805b), AI_AGENT_GUIDE.md (11051b), ai_agent.py (21462b), demo.py (7188b), QUICK_REFERENCE.md (5522b), SKILL.md (14085b), _meta.json (134b)\n\nFile v1.0.0:SKILL.md\n\n---\r\ndescription: Advanced desktop automation with mouse, keyboard, and screen control\r\n---\r\n\r\n# Desktop Control Skill\r\n\r\n**The most advanced desktop automation skill for OpenClaw.** Provides pixel-perfect mouse control, lightning-fast keyboard input, screen capture, window management, and clipboard operations.\r\n\r\n## 🎯 Features\r\n\r\n### Mouse Control\r\n- ✅ **Absolute positioning** - Move to exact coordinates\r\n- ✅ **Relative movement** - Move from current position\r\n- ✅ **Smooth movement** - Natural, human-like mouse paths\r\n- ✅ **Click types** - Left, right, middle, double, triple clicks\r\n- ✅ **Drag & drop** - Drag from point A to point B\r\n- ✅ **Scroll** - Vertical and horizontal scrolling\r\n- ✅ **Position tracking** - Get current mouse coordinates\r\n\r\n### Keyboard Control\r\n- ✅ **Text typing** - Fast, accurate text input\r\n- ✅ **Hotkeys** - Execute keyboard shortcuts (Ctrl+C, Win+R, etc.)\r\n- ✅ **Special keys** - Enter, Tab, Escape, Arrow keys, F-keys\r\n- ✅ **Key combinations** - Multi-key press combinations\r\n- ✅ **Hold & release** - Manual key state control\r\n- ✅ **Typing speed** - Configurable WPM (instant to human-like)\r\n\r\n### Screen Operations\r\n- ✅ **Screenshot** - Capture entire screen or regions\r\n- ✅ **Image recognition** - Find elements on screen (via OpenCV)\r\n- ✅ **Color detection** - Get pixel colors at coordinates\r\n- ✅ **Multi-monitor** - Support for multiple displays\r\n\r\n### Window Management\r\n- ✅ **Window list** - Get all open windows\r\n- ✅ **Activate window** - Bring window to front\r\n- ✅ **Window info** - Get position, size, title\r\n- ✅ **Minimize/Maximize** - Control window states\r\n\r\n### Safety Features\r\n- ✅ **Failsafe** - Move mouse to corner to abort\r\n- ✅ **Pause control** - Emergency stop mechanism\r\n- ✅ **Approval mode** - Require confirmation for actions\r\n- ✅ **Bounds checking** - Prevent out-of-screen operations\r\n- ✅ **Logging** - Track all automation actions\r\n\r\n---\r\n\r\n## 🚀 Quick Start\r\n\r\n### Installation\r\n\r\nFirst, install required dependencies:\r\n\r\n```bash\r\npip install pyautogui pillow opencv-python pygetwindow\r\n```\r\n\r\n### Basic Usage\r\n\r\n```python\r\nfrom skills.desktop_control import DesktopController\r\n\r\n# Initialize controller\r\ndc = DesktopController(failsafe=True)\r\n\r\n# Mouse operations\r\ndc.move_mouse(500, 300)  # Move to coordinates\r\ndc.click()  # Left click at current position\r\ndc.click(100, 200, button=\"right\")  # Right click at position\r\n\r\n# Keyboard operations\r\ndc.type_text(\"Hello from OpenClaw!\")\r\ndc.hotkey(\"ctrl\", \"c\")  # Copy\r\ndc.press(\"enter\")\r\n\r\n# Screen operations\r\nscreenshot = dc.screenshot()\r\nposition = dc.get_mouse_position()\r\n```\r\n\r\n---\r\n\r\n## 📋 Complete API Reference\r\n\r\n### Mouse Functions\r\n\r\n#### `move_mouse(x, y, duration=0, smooth=True)`\r\nMove mouse to absolute screen coordinates.\r\n\r\n**Parameters:**\r\n- `x` (int): X coordinate (pixels from left)\r\n- `y` (int): Y coordinate (pixels from top)\r\n- `duration` (float): Movement time in seconds (0 = instant, 0.5 = smooth)\r\n- `smooth` (bool): Use bezier curve for natural movement\r\n\r\n**Example:**\r\n```python\r\n# Instant movement\r\ndc.move_mouse(1000, 500)\r\n\r\n# Smooth 1-second movement\r\ndc.move_mouse(1000, 500, duration=1.0)\r\n```\r\n\r\n#### `move_relative(x_offset, y_offset, duration=0)`\r\nMove mouse relative to current position.\r\n\r\n**Parameters:**\r\n- `x_offset` (int): Pixels to move horizontally (positive = right)\r\n- `y_offset` (int): Pixels to move vertically (positive = down)\r\n- `duration` (float): Movement time in seconds\r\n\r\n**Example:**\r\n```python\r\n# Move 100px right, 50px down\r\ndc.move_relative(100, 50, duration=0.3)\r\n```\r\n\r\n#### `click(x=None, y=None, button='left', clicks=1, interval=0.1)`\r\nPerform mouse click.\r\n\r\n**Parameters:**\r\n- `x, y` (int, optional): Coordinates to click (None = current position)\r\n- `button` (str): 'left', 'right', 'middle'\r\n- `clicks` (int): Number of clicks (1 = single, 2 = double)\r\n- `interval` (float): Delay between multiple clicks\r\n\r\n**Example:**\r\n```python\r\n# Simple left click\r\ndc.click()\r\n\r\n# Double-click at specific position\r\ndc.click(500, 300, clicks=2)\r\n\r\n# Right-click\r\ndc.click(button='right')\r\n```\r\n\r\n#### `drag(start_x, start_y, end_x, end_y, duration=0.5, button='left')`\r\nDrag and drop operation.\r\n\r\n**Parameters:**\r\n- `start_x, start_y` (int): Starting coordinates\r\n- `end_x, end_y` (int): Ending coordinates\r\n- `duration` (float): Drag duration\r\n- `button` (str): Mouse button to use\r\n\r\n**Example:**\r\n```python\r\n# Drag file from desktop to folder\r\ndc.drag(100, 100, 500, 500, duration=1.0)\r\n```\r\n\r\n#### `scroll(clicks, direction='vertical', x=None, y=None)`\r\nScroll mouse wheel.\r\n\r\n**Parameters:**\r\n- `clicks` (int): Scroll amount (positive = up/left, negative = down/right)\r\n- `direction` (str): 'vertical' or 'horizontal'\r\n- `x, y` (int, optional): Position to scroll at\r\n\r\n**Example:**\r\n```python\r\n# Scroll down 5 clicks\r\ndc.scroll(-5)\r\n\r\n# Scroll up 10 clicks\r\ndc.scroll(10)\r\n\r\n# Horizontal scroll\r\ndc.scroll(5, direction='horizontal')\r\n```\r\n\r\n#### `get_mouse_position()`\r\nGet current mouse coordinates.\r\n\r\n**Returns:** `(x, y)` tuple\r\n\r\n**Example:**\r\n```python\r\nx, y = dc.get_mouse_position()\r\nprint(f\"Mouse is at: {x}, {y}\")\r\n```\r\n\r\n---\r\n\r\n### Keyboard Functions\r\n\r\n#### `type_text(text, interval=0, wpm=None)`\r\nType text with configurable speed.\r\n\r\n**Parameters:**\r\n- `text` (str): Text to type\r\n- `interval` (float): Delay between keystrokes (0 = instant)\r\n- `wpm` (int, optional): Words per minute (overrides interval)\r\n\r\n**Example:**\r\n```python\r\n# Instant typing\r\ndc.type_text(\"Hello World\")\r\n\r\n# Human-like typing at 60 WPM\r\ndc.type_text(\"Hello World\", wpm=60)\r\n\r\n# Slow typing with 0.1s between keys\r\ndc.type_text(\"Hello World\", interval=0.1)\r\n```\r\n\r\n#### `press(key, presses=1, interval=0.1)`\r\nPress and release a key.\r\n\r\n**Parameters:**\r\n- `key` (str): Key name (see Key Names section)\r\n- `presses` (int): Number of times to press\r\n- `interval` (float): Delay between presses\r\n\r\n**Example:**\r\n```python\r\n# Press Enter\r\ndc.press('enter')\r\n\r\n# Press Space 3 times\r\ndc.press('space', presses=3)\r\n\r\n# Press Down arrow\r\ndc.press('down')\r\n```\r\n\r\n#### `hotkey(*keys, interval=0.05)`\r\nExecute keyboard shortcut.\r\n\r\n**Parameters:**\r\n- `*keys` (str): Keys to press together\r\n- `interval` (float): Delay between key presses\r\n\r\n**Example:**\r\n```python\r\n# Copy (Ctrl+C)\r\ndc.hotkey('ctrl', 'c')\r\n\r\n# Paste (Ctrl+V)\r\ndc.hotkey('ctrl', 'v')\r\n\r\n# Open Run dialog (Win+R)\r\ndc.hotkey('win', 'r')\r\n\r\n# Save (Ctrl+S)\r\ndc.hotkey('ctrl', 's')\r\n\r\n# Select All (Ctrl+A)\r\ndc.hotkey('ctrl', 'a')\r\n```\r\n\r\n#### `key_down(key)` / `key_up(key)`\r\nManually control key state.\r\n\r\n**Example:**\r\n```python\r\n# Hold Shift\r\ndc.key_down('shift')\r\ndc.type_text(\"hello\")  # Types \"HELLO\"\r\ndc.key_up('shift')\r\n\r\n# Hold Ctrl and click (for multi-select)\r\ndc.key_down('ctrl')\r\ndc.click(100, 100)\r\ndc.click(200, 100)\r\ndc.key_up('ctrl')\r\n```\r\n\r\n---\r\n\r\n### Screen Functions\r\n\r\n#### `screenshot(region=None, filename=None)`\r\nCapture screen or region.\r\n\r\n**Parameters:**\r\n- `region` (tuple, optional): (left, top, width, height) for partial capture\r\n- `filename` (str, optional): Path to save image\r\n\r\n**Returns:** PIL Image object\r\n\r\n**Example:**\r\n```python\r\n# Full screen\r\nimg = dc.screenshot()\r\n\r\n# Save to file\r\ndc.screenshot(filename=\"screenshot.png\")\r\n\r\n# Capture specific region\r\nimg = dc.screenshot(region=(100, 100, 500, 300))\r\n```\r\n\r\n#### `get_pixel_color(x, y)`\r\nGet color of pixel at coordinates.\r\n\r\n**Returns:** RGB tuple `(r, g, b)`\r\n\r\n**Example:**\r\n```python\r\nr, g, b = dc.get_pixel_color(500, 300)\r\nprint(f\"Color at (500, 300): RGB({r}, {g}, {b})\")\r\n```\r\n\r\n#### `find_on_screen(image_path, confidence=0.8)`\r\nFind image on screen (requires OpenCV).\r\n\r\n**Parameters:**\r\n- `image_path` (str): Path to template image\r\n- `confidence` (float): Match threshold (0-1)\r\n\r\n**Returns:** `(x, y, width, height)` or None\r\n\r\n**Example:**\r\n```python\r\n# Find button on screen\r\nlocation = dc.find_on_screen(\"button.png\")\r\nif location:\r\n    x, y, w, h = location\r\n    # Click center of found image\r\n    dc.click(x + w//2, y + h//2)\r\n```\r\n\r\n#### `get_screen_size()`\r\nGet screen resolution.\r\n\r\n**Returns:** `(width, height)` tuple\r\n\r\n**Example:**\r\n```python\r\nwidth, height = dc.get_screen_size()\r\nprint(f\"Screen: {width}x{height}\")\r\n```\r\n\r\n---\r\n\r\n### Window Functions\r\n\r\n#### `get_all_windows()`\r\nList all open windows.\r\n\r\n**Returns:** List of window titles\r\n\r\n**Example:**\r\n```python\r\nwindows = dc.get_all_windows()\r\nfor title in windows:\r\n    print(f\"Window: {title}\")\r\n```\r\n\r\n#### `activate_window(title_substring)`\r\nBring window to front by title.\r\n\r\n**Parameters:**\r\n- `title_substring` (str): Part of window title to match\r\n\r\n**Example:**\r\n```python\r\n# Activate Chrome\r\ndc.activate_window(\"Chrome\")\r\n\r\n# Activate VS Code\r\ndc.activate_window(\"Visual Studio Code\")\r\n```\r\n\r\n#### `get_active_window()`\r\nGet currently focused window.\r\n\r\n**Returns:** Window title (str)\r\n\r\n**Example:**\r\n```python\r\nactive = dc.get_active_window()\r\nprint(f\"Active window: {active}\")\r\n```\r\n\r\n---\r\n\r\n### Clipboard Functions\r\n\r\n#### `copy_to_clipboard(text)`\r\nCopy text to clipboard.\r\n\r\n**Example:**\r\n```python\r\ndc.copy_to_clipboard(\"Hello from OpenClaw!\")\r\n```\r\n\r\n#### `get_from_clipboard()`\r\nGet text from clipboard.\r\n\r\n**Returns:** str\r\n\r\n**Example:**\r\n```python\r\ntext = dc.get_from_clipboard()\r\nprint(f\"Clipboard: {text}\")\r\n```\r\n\r\n---\r\n\r\n## ⌨️ Key Names Reference\r\n\r\n### Alphabet Keys\r\n`'a'` through `'z'`\r\n\r\n### Number Keys\r\n`'0'` through `'9'`\r\n\r\n### Function Keys\r\n`'f1'` through `'f24'`\r\n\r\n### Special Keys\r\n- `'enter'` / `'return'`\r\n- `'esc'` / `'escape'`\r\n- `'space'` / `'spacebar'`\r\n- `'tab'`\r\n- `'backspace'`\r\n- `'delete'` / `'del'`\r\n- `'insert'`\r\n- `'home'`\r\n- `'end'`\r\n- `'pageup'` / `'pgup'`\r\n- `'pagedown'` / `'pgdn'`\r\n\r\n### Arrow Keys\r\n- `'up'` / `'down'` / `'left'` / `'right'`\r\n\r\n### Modifier Keys\r\n- `'ctrl'` / `'control'`\r\n- `'shift'`\r\n- `'alt'`\r\n- `'win'` / `'winleft'` / `'winright'`\r\n- `'cmd'` / `'command'` (Mac)\r\n\r\n### Lock Keys\r\n- `'capslock'`\r\n- `'numlock'`\r\n- `'scrolllock'`\r\n\r\n### Punctuation\r\n- `'.'` / `','` / `'?'` / `'!'` / `';'` / `':'`\r\n- `'['` / `']'` / `'{'` / `'}'`\r\n- `'('` / `')'`\r\n- `'+'` / `'-'` / `'*'` / `'/'` / `'='`\r\n\r\n---\r\n\r\n## 🛡️ Safety Features\r\n\r\n### Failsafe Mode\r\n\r\nMove mouse to **any corner** of the screen to abort all automation.\r\n\r\n```python\r\n# Enable failsafe (enabled by default)\r\ndc = DesktopController(failsafe=True)\r\n```\r\n\r\n### Pause Control\r\n\r\n```python\r\n# Pause all automation for 2 seconds\r\ndc.pause(2.0)\r\n\r\n# Check if automation is safe to proceed\r\nif dc.is_safe():\r\n    dc.click(500, 500)\r\n```\r\n\r\n### Approval Mode\r\n\r\nRequire user confirmation before actions:\r\n\r\n```python\r\ndc = DesktopController(require_approval=True)\r\n\r\n# This will ask for confirmation\r\ndc.click(500, 500)  # Prompt: \"Allow click at (500, 500)? [y/n]\"\r\n```\r\n\r\n---\r\n\r\n## 🎨 Advanced Examples\r\n\r\n### Example 1: Automated Form Filling\r\n\r\n```python\r\ndc = DesktopController()\r\n\r\n# Click name field\r\ndc.click(300, 200)\r\ndc.type_text(\"John Doe\", wpm=80)\r\n\r\n# Tab to next field\r\ndc.press('tab')\r\ndc.type_text(\"john@example.com\", wpm=80)\r\n\r\n# Tab to password\r\ndc.press('tab')\r\ndc.type_text(\"SecurePassword123\", wpm=60)\r\n\r\n# Submit form\r\ndc.press('enter')\r\n```\r\n\r\n### Example 2: Screenshot Region and Save\r\n\r\n```python\r\n# Capture specific area\r\nregion = (100, 100, 800, 600)  # left, top, width, height\r\nimg = dc.screenshot(region=region)\r\n\r\n# Save with timestamp\r\nimport datetime\r\ntimestamp = datetime.datetime.now().strftime(\"%Y%m%d_%H%M%S\")\r\nimg.save(f\"capture_{timestamp}.png\")\r\n```\r\n\r\n### Example 3: Multi-File Selection\r\n\r\n```python\r\n# Hold Ctrl and click multiple files\r\ndc.key_down('ctrl')\r\ndc.click(100, 200)  # First file\r\ndc.click(100, 250)  # Second file\r\ndc.click(100, 300)  # Third file\r\ndc.key_up('ctrl')\r\n\r\n# Copy selected files\r\ndc.hotkey('ctrl', 'c')\r\n```\r\n\r\n### Example 4: Window Automation\r\n\r\n```python\r\n# Activate Calculator\r\ndc.activate_window(\"Calculator\")\r\ntime.sleep(0.5)\r\n\r\n# Type calculation\r\ndc.type_text(\"5+3=\", interval=0.2)\r\ntime.sleep(0.5)\r\n\r\n# Take screenshot of result\r\ndc.screenshot(filename=\"calculation_result.png\")\r\n```\r\n\r\n### Example 5: Drag & Drop File\r\n\r\n```python\r\n# Drag file from source to destination\r\ndc.drag(\r\n    start_x=200, start_y=300,  # File location\r\n    end_x=800, end_y=500,       # Folder location\r\n    duration=1.0                 # Smooth 1-second drag\r\n)\r\n```\r\n\r\n---\r\n\r\n## ⚡ Performance Tips\r\n\r\n1. **Use instant movements** for speed: `duration=0`\r\n2. **Batch operations** instead of individual calls\r\n3. **Cache screen positions** instead of recalculating\r\n4. **Disable failsafe** for maximum performance (use with caution)\r\n5. **Use hotkeys** instead of menu navigation\r\n\r\n---\r\n\r\n## ⚠️ Important Notes\r\n\r\n- **Screen coordinates** start at (0, 0) in top-left corner\r\n- **Multi-monitor setups** may have negative coordinates for secondary displays\r\n- **Windows DPI scaling** may affect coordinate accuracy\r\n- **Failsafe corners** are: (0,0), (width-1, 0), (0, height-1), (width-1, height-1)\r\n- **Some applications** may block simulated input (games, secure apps)\r\n\r\n---\r\n\r\n## 🔧 Troubleshooting\r\n\r\n### Mouse not moving to correct position\r\n- Check DPI scaling settings\r\n- Verify screen resolution matches expectations\r\n- Use `get_screen_size()` to confirm dimensions\r\n\r\n### Keyboard input not working\r\n- Ensure target application has focus\r\n- Some apps require admin privileges\r\n- Try increasing `interval` for reliability\r\n\r\n### Failsafe triggering accidentally\r\n- Increase screen border tolerance\r\n- Move mouse away from corners during normal use\r\n- Disable if needed: `DesktopController(failsafe=False)`\r\n\r\n### Permission errors\r\n- Run Python with administrator privileges for some operations\r\n- Some secure applications block automation\r\n\r\n---\r\n\r\n## 📦 Dependencies\r\n\r\n- **PyAutoGUI** - Core automation engine\r\n- **Pillow** - Image processing\r\n- **OpenCV** (optional) - Image recognition\r\n- **PyGetWindow** - Window management\r\n\r\nInstall all:\r\n```bash\r\npip install pyautogui pillow opencv-python pygetwindow\r\n```\r\n\r\n---\r\n\r\n**Built for OpenClaw** - The ultimate desktop automation companion 🦞\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7ag28ra4hhta8bx2k2j1kpv180kqbk\",\n  \"slug\": \"desktop-control\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1770255200863\n}\n\nFile v1.0.0:AI_AGENT_GUIDE.md\n\n# AI Desktop Agent - Cognitive Automation Guide\r\n\r\n## 🤖 What Is This?\r\n\r\nThe **AI Desktop Agent** is an intelligent layer on top of the basic desktop control that **understands** what you want and figures out how to do it autonomously.\r\n\r\nUnlike basic automation that requires exact instructions, the AI Agent:\r\n- **Understands natural language** (\"Draw a cat in Paint\")\r\n- **Plans the steps** automatically\r\n- **Executes autonomously** \r\n- **Adapts** based on what it sees\r\n\r\n---\r\n\r\n## 🎯 What Can It Do?\r\n\r\n### ✅ Autonomous Drawing\r\n```python\r\nfrom skills.desktop_control.ai_agent import AIDesktopAgent\r\n\r\nagent = AIDesktopAgent()\r\n\r\n# Just describe what you want!\r\nagent.execute_task(\"Draw a circle in Paint\")\r\nagent.execute_task(\"Draw a star in MS Paint\")\r\nagent.execute_task(\"Draw a house with a sun\")\r\n```\r\n\r\n**What it does:**\r\n1. Opens MS Paint\r\n2. Selects pencil tool\r\n3. Figures out how to draw the requested shape\r\n4. Draws it autonomously\r\n5. Takes a screenshot of the result\r\n\r\n### ✅ Autonomous Text Entry\r\n```python\r\n# It figures out where to type\r\nagent.execute_task(\"Type 'Hello World' in Notepad\")\r\nagent.execute_task(\"Write an email saying thank you\")\r\n```\r\n\r\n**What it does:**\r\n1. Opens Notepad (or finds active text editor)\r\n2. Types the text naturally\r\n3. Formats if needed\r\n\r\n### ✅ Autonomous Application Control\r\n```python\r\n# It knows how to open apps\r\nagent.execute_task(\"Open Calculator\")\r\nagent.execute_task(\"Launch Microsoft Paint\")\r\nagent.execute_task(\"Open File Explorer\")\r\n```\r\n\r\n### ✅ Autonomous Game Playing (Advanced)\r\n```python\r\n# It will try to play the game!\r\nagent.execute_task(\"Play Solitaire for me\")\r\nagent.execute_task(\"Play Minesweeper\")\r\n```\r\n\r\n**What it does:**\r\n1. Analyzes the game screen\r\n2. Detects game state (cards, mines, etc.)\r\n3. Decides best move\r\n4. Executes the move\r\n5. Repeats until win/lose\r\n\r\n---\r\n\r\n## 🏗️ How It Works\r\n\r\n### Architecture\r\n\r\n```\r\nUser Request (\"Draw a cat\")\r\n    ↓\r\nNatural Language Understanding\r\n    ↓\r\nTask Planning (Step-by-step plan)\r\n    ↓\r\nStep Execution Loop:\r\n    - Observe Screen (Computer Vision)\r\n    - Decide Action (AI Reasoning)\r\n    - Execute Action (Desktop Control)\r\n    - Verify Result\r\n    ↓\r\nTask Complete!\r\n```\r\n\r\n### Key Components\r\n\r\n1. **Task Planner** - Breaks down high-level tasks into steps\r\n2. **Vision System** - Understands what's on screen (screenshots, OCR, object detection)\r\n3. **Reasoning Engine** - Decides what to do next\r\n4. **Action Executor** - Performsthe actual mouse/keyboard actions\r\n5. **Feedback Loop** - Verifies actions succeeded\r\n\r\n---\r\n\r\n## 📋 Supported Tasks (Current)\r\n\r\n### Tier 1: Fully Automated ✅\r\n\r\n| Task Pattern | Example | Status |\r\n|-------------|---------|---------|\r\n| Draw shapes in Paint | \"Draw a circle\" | ✅ Working |\r\n| Basic text entry | \"Type Hello\" | ✅ Working |\r\n| Launch applications | \"Open Paint\" | ✅ Working |\r\n\r\n### Tier 2: Partially Automated 🔨\r\n\r\n| Task Pattern | Example | Status |\r\n|-------------|---------|---------|\r\n| Form filling | \"Fill out this form\" | 🔨 In Progress |\r\n| File operations | \"Copy these files\" | 🔨 In Progress |\r\n| Web navigation | \"Find on Google\" | 🔨 Planned |\r\n\r\n### Tier 3: Experimental 🧪\r\n\r\n| Task Pattern | Example | Status |\r\n|-------------|---------|---------|\r\n| Game playing | \"Play Solitaire\" | 🧪 Experimental |\r\n| Image editing | \"Resize this photo\" | 🧪 Planned |\r\n| Code editing | \"Fix this bug\" | 🧪 Research |\r\n\r\n---\r\n\r\n## 🎨 Example: Drawing in Paint\r\n\r\n### Simple Request\r\n```python\r\nagent = AIDesktopAgent()\r\nresult = agent.execute_task(\"Draw a circle in Paint\")\r\n\r\n# Check result\r\nprint(f\"Status: {result['status']}\")\r\nprint(f\"Steps taken: {len(result['steps'])}\")\r\n```\r\n\r\n### What Happens Behind the Scenes\r\n\r\n**1. Planning Phase:**\r\n```\r\nPlan generated:\r\n  Step 1: Launch MS Paint\r\n  Step 2: Wait 2s for Paint to load\r\n  Step 3: Activate Paint window\r\n  Step 4: Select pencil tool (press 'P')\r\n  Step 5: Draw circle at canvas center\r\n  Step 6: Screenshot the result\r\n```\r\n\r\n**2. Execution Phase:**\r\n```\r\n[✓] Launched Paint via Win+R → mspaint\r\n[✓] Waited 2.0s\r\n[✓] Activated window \"Paint\"\r\n[✓] Pressed 'P' to select pencil\r\n[✓] Drew circle with 72 points\r\n[✓] Screenshot saved: drawing_result.png\r\n```\r\n\r\n**3. Result:**\r\n```python\r\n{\r\n    \"task\": \"Draw a circle in Paint\",\r\n    \"status\": \"completed\",\r\n    \"success\": True,\r\n    \"steps\": [... 6 steps ...],\r\n    \"screenshots\": [... 6 screenshots ...],\r\n}\r\n```\r\n\r\n---\r\n\r\n## 🎮 Example: Game Playing\r\n\r\n```python\r\nagent = AIDesktopAgent()\r\n\r\n# Play a simple game\r\nresult = agent.execute_task(\"Play Solitaire for me\")\r\n```\r\n\r\n### Game Playing Loop\r\n\r\n```\r\n1. Analyze screen → Detect cards, positions\r\n2. Identify valid moves → Find legal plays\r\n3. Evaluate moves → Which is best?\r\n4. Execute move → Click and drag card\r\n5. Repeat until game ends\r\n```\r\n\r\n### Game-Specific Intelligence\r\n\r\nThe agent can learn patterns for:\r\n- **Solitaire**: Card stacking rules, suit matching\r\n- **Minesweeper**: Probability calculations, safe clicks\r\n- **2048**: Tile merging strategy\r\n- **Chess** (if integrated with engine): Move evaluation\r\n\r\n---\r\n\r\n## 🧠 Enhancing the AI\r\n\r\n### Adding Application Knowledge\r\n\r\n```python\r\n# In ai_agent.py, add to app_knowledge:\r\n\r\nself.app_knowledge = {\r\n    \"photoshop\": {\r\n        \"name\": \"Adobe Photoshop\",\r\n        \"launch_command\": \"photoshop\",\r\n        \"common_actions\": {\r\n            \"new_layer\": {\"hotkey\": [\"ctrl\", \"shift\", \"n\"]},\r\n            \"brush_tool\": {\"hotkey\": [\"b\"]},\r\n            \"eraser\": {\"hotkey\": [\"e\"]},\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n### Adding Custom Task Patterns\r\n\r\n```python\r\n# Add a custom planning method\r\ndef _plan_photo_edit(self, task: str) -> List[Dict]:\r\n    \"\"\"Plan for photo editing tasks.\"\"\"\r\n    return [\r\n        {\"type\": \"launch_app\", \"app\": \"photoshop\"},\r\n        {\"type\": \"wait\", \"duration\": 3.0},\r\n        {\"type\": \"open_file\", \"path\": extracted_path},\r\n        {\"type\": \"apply_filter\", \"filter\": extracted_filter},\r\n        {\"type\": \"save_file\"},\r\n    ]\r\n```\r\n\r\n---\r\n\r\n## 🔥 Advanced: Vision + Reasoning\r\n\r\n### Screen Analysis\r\n\r\nThe agent can analyze screenshots to:\r\n- **Detect UI elements** (buttons, text fields, menus)\r\n- **Read text** (OCR for labels, instructions)\r\n- **Identify objects** (icons, images, game pieces)\r\n- **Understand layout** (where things are)\r\n\r\n```python\r\n# Analyze what's on screen\r\nanalysis = agent._analyze_screen()\r\n\r\nprint(analysis)\r\n# Output:\r\n# {\r\n#     \"active_window\": \"Untitled - Paint\",\r\n#     \"mouse_position\": (640, 480),\r\n#     \"detected_elements\": [...],\r\n#     \"text_found\": [...],\r\n# }\r\n```\r\n\r\n### Integration with OpenClaw LLM\r\n\r\n```python\r\n# Future: Use OpenClaw's LLM for reasoning\r\nagent = AIDesktopAgent(llm_client=openclaw_llm)\r\n\r\n# The agent can now:\r\n# - Reason about complex tasks\r\n# - Understand context better\r\n# - Plan more sophisticated workflows\r\n# - Learn from feedback\r\n```\r\n\r\n---\r\n\r\n## 🛠️ Extending for Your Needs\r\n\r\n### Add Support for New Apps\r\n\r\n1. **Identify the app**\r\n2. **Document common actions**\r\n3. **Add to knowledge base**\r\n4. **Create planning method**\r\n\r\nExample: Adding Excel support\r\n\r\n```python\r\n# Step 1: Add to app_knowledge\r\n\"excel\": {\r\n    \"name\": \"Microsoft Excel\",\r\n    \"launch_command\": \"excel\",\r\n    \"common_actions\": {\r\n        \"new_sheet\": {\"hotkey\": [\"shift\", \"f11\"]},\r\n        \"sum_formula\": {\"action\": \"type\", \"text\": \"=SUM()\"},\r\n    }\r\n}\r\n\r\n# Step 2: Create planner\r\ndef _plan_excel_task(self, task: str) -> List[Dict]:\r\n    return [\r\n        {\"type\": \"launch_app\", \"app\": \"excel\"},\r\n        {\"type\": \"wait\", \"duration\": 2.0},\r\n        # ... specific Excel steps\r\n    ]\r\n\r\n# Step 3: Hook into main planner\r\nif \"excel\" in task_lower or \"spreadsheet\" in task_lower:\r\n    return self._plan_excel_task(task)\r\n```\r\n\r\n---\r\n\r\n## 🎯 Real-World Use Cases\r\n\r\n### 1. Automated Form Filling\r\n```python\r\nagent.execute_task(\"Fill out the job application with my resume data\")\r\n```\r\n\r\n### 2. Batch Image Processing\r\n```python\r\nagent.execute_task(\"Resize all images in this folder to 800x600\")\r\n```\r\n\r\n### 3. Social Media Posting\r\n```python\r\nagent.execute_task(\"Post this image to Instagram with caption 'Beautiful sunset'\")\r\n```\r\n\r\n### 4. Data Entry\r\n```python\r\nagent.execute_task(\"Copy data from this PDF to Excel spreadsheet\")\r\n```\r\n\r\n### 5. Testing\r\n```python\r\nagent.execute_task(\"Test the login form with invalid credentials\")\r\n```\r\n\r\n---\r\n\r\n## ⚙️ Configuration\r\n\r\n### Enable/Disable Failsafe\r\n```python\r\n# Safe mode (default)\r\nagent = AIDesktopAgent(failsafe=True)\r\n\r\n# Fast mode (no failsafe)\r\nagent = AIDesktopAgent(failsafe=False)\r\n```\r\n\r\n### Set Max Steps\r\n```python\r\n# Prevent infinite loops\r\nresult = agent.execute_task(\"Play game\", max_steps=100)\r\n```\r\n\r\n### Access Action History\r\n```python\r\n# Review what the agent did\r\nprint(agent.action_history)\r\n```\r\n\r\n---\r\n\r\n## 🐛 Debugging\r\n\r\n### View Step-by-Step Execution\r\n```python\r\nresult = agent.execute_task(\"Draw a star in Paint\")\r\n\r\nfor i, step in enumerate(result['steps'], 1):\r\n    print(f\"Step {i}: {step['step']['description']}\")\r\n    print(f\"  Success: {step['success']}\")\r\n    if 'error' in step:\r\n        print(f\"  Error: {step['error']}\")\r\n```\r\n\r\n### View Screenshots\r\n```python\r\n# Each step captures before/after screenshots\r\nfor screenshot_pair in result['screenshots']:\r\n    before = screenshot_pair['before']\r\n    after = screenshot_pair['after']\r\n    \r\n    # Display or save for analysis\r\n    before.save(f\"step_{screenshot_pair['step']}_before.png\")\r\n    after.save(f\"step_{screenshot_pair['step']}_after.png\")\r\n```\r\n\r\n---\r\n\r\n## 🚀 Future Enhancements\r\n\r\nPlanned features:\r\n\r\n- [ ] **Computer Vision**: OCR, object detection, UI element recognition\r\n- [ ] **LLM Integration**: Natural language understanding with OpenClaw LLM\r\n- [ ] **Learning**: Remember successful patterns, improve over time\r\n- [ ] **Multi-App Workflows**: \"Get data from Chrome and put in Excel\"\r\n- [ ] **Voice Control**: \"Alexa, draw a cat in Paint\"\r\n- [ ] **Autonomous Debugging**: Fix errors automatically\r\n- [ ] **Game AI**: Reinforcement learning for game playing\r\n- [ ] **Web Automation**: Full browser control with understanding\r\n\r\n---\r\n\r\n## 📚 Full API\r\n\r\n### Main Methods\r\n\r\n```python\r\n# Execute a task\r\nresult = agent.execute_task(task: str, max_steps: int = 50)\r\n\r\n# Analyze screen\r\nanalysis = agent._analyze_screen()\r\n\r\n# Manual mode: Execute individual steps\r\nstep = {\"type\": \"launch_app\", \"app\": \"paint\"}\r\nresult = agent._execute_step(step)\r\n```\r\n\r\n### Result Structure\r\n\r\n```python\r\n{\r\n    \"task\": str,                    # Original task\r\n    \"status\": str,                  # \"completed\", \"failed\", \"error\"\r\n    \"success\": bool,                # Overall success\r\n    \"steps\": List[Dict],            # All steps executed\r\n    \"screenshots\": List[Dict],      # Before/after screenshots\r\n    \"failed_at_step\": int,          # If failed, which step\r\n    \"error\": str,                   # Error message if failed\r\n}\r\n```\r\n\r\n---\r\n\r\n**🦞 Built for OpenClaw - The future of desktop automation!**\n\nFile v1.0.0:QUICK_REFERENCE.md\n\n# Desktop Control - Quick Reference Card\r\n\r\n## 🚀 Instant Start\r\n\r\n```python\r\nfrom skills.desktop_control import DesktopController\r\n\r\ndc = DesktopController()\r\n```\r\n\r\n## 🖱️ Mouse Control (Top 10)\r\n\r\n```python\r\n# 1. Move mouse\r\ndc.move_mouse(500, 300, duration=0.5)\r\n\r\n# 2. Click\r\ndc.click(500, 300)  # Left click at position\r\ndc.click()           # Click at current position\r\n\r\n# 3. Right click\r\ndc.right_click(500, 300)\r\n\r\n# 4. Double click\r\ndc.double_click(500, 300)\r\n\r\n# 5. Drag & drop\r\ndc.drag(100, 100, 500, 500, duration=1.0)\r\n\r\n# 6. Scroll\r\ndc.scroll(-5)  # Scroll down 5 clicks\r\n\r\n# 7. Get position\r\nx, y = dc.get_mouse_position()\r\n\r\n# 8. Move relative\r\ndc.move_relative(100, 50)  # Move 100px right, 50px down\r\n\r\n# 9. Smooth movement\r\ndc.move_mouse(1000, 500, duration=1.0, smooth=True)\r\n\r\n# 10. Middle click\r\ndc.middle_click()\r\n```\r\n\r\n## ⌨️ Keyboard Control (Top 10)\r\n\r\n```python\r\n# 1. Type text (instant)\r\ndc.type_text(\"Hello World\")\r\n\r\n# 2. Type text (human-like, 60 WPM)\r\ndc.type_text(\"Hello World\", wpm=60)\r\n\r\n# 3. Press key\r\ndc.press('enter')\r\ndc.press('tab')\r\ndc.press('escape')\r\n\r\n# 4. Hotkeys (shortcuts)\r\ndc.hotkey('ctrl', 'c')      # Copy\r\ndc.hotkey('ctrl', 'v')      # Paste  \r\ndc.hotkey('ctrl', 's')      # Save\r\ndc.hotkey('win', 'r')       # Run dialog\r\ndc.hotkey('alt', 'tab')     # Switch window\r\n\r\n# 5. Hold & release\r\ndc.key_down('shift')\r\ndc.type_text(\"hello\")  # Types \"HELLO\"\r\ndc.key_up('shift')\r\n\r\n# 6. Arrow keys\r\ndc.press('up')\r\ndc.press('down')\r\ndc.press('left')\r\ndc.press('right')\r\n\r\n# 7. Function keys\r\ndc.press('f5')  # Refresh\r\n\r\n# 8. Multiple presses\r\ndc.press('backspace', presses=5)\r\n\r\n# 9. Special keys\r\ndc.press('home')\r\ndc.press('end')\r\ndc.press('pagedown')\r\ndc.press('delete')\r\n\r\n# 10. Fast combo\r\ndc.hotkey('ctrl', 'alt', 'delete')\r\n```\r\n\r\n## 📸 Screen Operations (Top 5)\r\n\r\n```python\r\n# 1. Screenshot (full screen)\r\nimg = dc.screenshot()\r\ndc.screenshot(filename=\"screen.png\")\r\n\r\n# 2. Screenshot (region)\r\nimg = dc.screenshot(region=(100, 100, 800, 600))\r\n\r\n# 3. Get pixel color\r\nr, g, b = dc.get_pixel_color(500, 300)\r\n\r\n# 4. Find image on screen\r\nlocation = dc.find_on_screen(\"button.png\")\r\n\r\n# 5. Get screen size\r\nwidth, height = dc.get_screen_size()\r\n```\r\n\r\n## 🪟 Window Management (Top 5)\r\n\r\n```python\r\n# 1. Get all windows\r\nwindows = dc.get_all_windows()\r\n\r\n# 2. Activate window\r\ndc.activate_window(\"Chrome\")\r\n\r\n# 3. Get active window\r\nactive = dc.get_active_window()\r\n\r\n# 4. List windows\r\nfor title in dc.get_all_windows():\r\n    print(title)\r\n\r\n# 5. Switch to app\r\ndc.activate_window(\"Visual Studio Code\")\r\n```\r\n\r\n## 📋 Clipboard (Top 2)\r\n\r\n```python\r\n# 1. Copy to clipboard\r\ndc.copy_to_clipboard(\"Hello!\")\r\n\r\n# 2. Get from clipboard\r\ntext = dc.get_from_clipboard()\r\n```\r\n\r\n## 🔥 Real-World Examples\r\n\r\n### Example 1: Auto-fill Form\r\n```python\r\ndc.click(300, 200)  # Name field\r\ndc.type_text(\"John Doe\", wpm=80)\r\ndc.press('tab')\r\ndc.type_text(\"john@email.com\", wpm=80)\r\ndc.press('tab')\r\ndc.type_text(\"Password123\", wpm=60)\r\ndc.press('enter')\r\n```\r\n\r\n### Example 2: Copy-Paste Automation\r\n```python\r\n# Select all\r\ndc.hotkey('ctrl', 'a')\r\n# Copy\r\ndc.hotkey('ctrl', 'c')\r\n# Wait\r\ndc.pause(0.5)\r\n# Switch window\r\ndc.hotkey('alt', 'tab')\r\n# Paste\r\ndc.hotkey('ctrl', 'v')\r\n```\r\n\r\n### Example 3: File Operations\r\n```python\r\n# Select multiple files\r\ndc.key_down('ctrl')\r\ndc.click(100, 200)\r\ndc.click(100, 250)\r\ndc.click(100, 300)\r\ndc.key_up('ctrl')\r\n# Copy\r\ndc.hotkey('ctrl', 'c')\r\n```\r\n\r\n### Example 4: Screenshot Workflow\r\n```python\r\n# Take screenshot\r\ndc.screenshot(filename=f\"capture_{time.time()}.png\")\r\n# Open in Paint\r\ndc.hotkey('win', 'r')\r\ndc.pause(0.5)\r\ndc.type_text('mspaint')\r\ndc.press('enter')\r\n```\r\n\r\n### Example 5: Search & Replace\r\n```python\r\n# Open Find & Replace\r\ndc.hotkey('ctrl', 'h')\r\ndc.pause(0.3)\r\n# Type find text\r\ndc.type_text(\"old_text\")\r\ndc.press('tab')\r\n# Type replace text\r\ndc.type_text(\"new_text\")\r\n# Replace all\r\ndc.hotkey('alt', 'a')\r\n```\r\n\r\n## ⚙️ Configuration\r\n\r\n```python\r\n# With failsafe (move to corner to abort)\r\ndc = DesktopController(failsafe=True)\r\n\r\n# With approval mode (ask before each action)\r\ndc = DesktopController(require_approval=True)\r\n\r\n# Maximum speed (no safety checks)\r\ndc = DesktopController(failsafe=False)\r\n```\r\n\r\n## 🛡️ Safety\r\n\r\n```python\r\n# Check if safe to continue\r\nif dc.is_safe():\r\n    dc.click(500, 500)\r\n\r\n# Pause execution\r\ndc.pause(2.0)  # Wait 2 seconds\r\n\r\n# Emergency abort: Move mouse to any screen corner\r\n```\r\n\r\n## 🎯 Pro Tips\r\n\r\n1. **Instant typing**: `interval=0` or `wpm=None`\r\n2. **Human typing**: `wpm=60` (60 words/min)\r\n3. **Smooth mouse**: `duration=0.5, smooth=True`\r\n4. **Instant mouse**: `duration=0`\r\n5. **Wait for UI**: `dc.pause(0.5)` between actions\r\n6. **Failsafe**: Always enable for safety\r\n7. **Test first**: Use `demo.py` to test features\r\n8. **Coordinates**: Use `get_mouse_position()` to find them\r\n9. **Screenshots**: Capture before/after for verification\r\n10. **Hotkeys > Menus**: Faster and more reliable\r\n\r\n## 📦 Dependencies\r\n\r\n```bash\r\npip install pyautogui pillow opencv-python pygetwindow pyperclip\r\n```\r\n\r\n## 🚨 Common Issues\r\n\r\n**Mouse not moving correctly?**\r\n- Check DPI scaling in Windows settings\r\n- Verify coordinates with `get_mouse_position()`\r\n\r\n**Keyboard not working?**\r\n- Ensure target app has focus\r\n- Some apps block automation (games, secure apps)\r\n\r\n**Failsafe triggering?**\r\n- Keep mouse away from screen corners\r\n- Disable if needed: `failsafe=False`\r\n\r\n---\r\n\r\n**Built for OpenClaw** 🦞 - Desktop automation made easy!","readmeExcerpt":"Skill: Desktop Control Owner: matagul Summary: Advanced desktop automation with mouse, keyboard, and screen control Tags: latest:1.0.0 Version history: v1.0.0 | 2026-02-05T01:33:20.863Z | auto Version 1.0.0 - Initial release of the Desktop Control skill for OpenClaw. - Provides advanced automation: mouse movement/clicks, keyboard input, hotkeys, and typing speed control. - Supports screen capture, region-based screen","codeSnippets":[],"executableExamples":[],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\r\ndescription: Advanced desktop automation with mouse, keyboard, and screen control\r\n---\r\n\r\n# Desktop Control Skill\r\n\r\n**The most advanced desktop automation skill for OpenClaw.** Provides pixel-perfect mouse control, lightning-fast keyboard input, screen capture, window management, and clipboard operations.\r\n\r\n## 🎯 Features\r\n\r\n### Mouse Control\r\n- ✅ **Absolute positioning** - Move to exact coordinates\r\n- ✅ **Relative movement** - Move from current position\r\n- ✅ **Smooth movement** - Natural, human-like mouse paths\r\n- ✅ **Click types** - Left, right, middle, double, triple clicks\r\n- ✅ **Drag & drop** - Drag from point A to point B\r\n- ✅ **Scroll** - Vertical and horizontal scrolling\r\n- ✅ **Position tracking** - Get current mouse coordinates\r\n\r\n### Keyboard Control\r\n- ✅ **Text typing** - Fast, accurate text input\r\n- ✅ **Hotkeys** - Execute keyboard shortcuts (Ctrl+C, Win+R, etc.)\r\n- ✅ **Special keys** - Enter, Tab, Escape, Arrow keys, F-keys\r\n- ✅ **Key combinations** - Multi-key press combinations\r\n- ✅ **Hold & release** - Manual key state control\r\n- ✅ **Typing speed** - Configurable WPM (instant to human-like)\r\n\r\n### Screen Operations\r\n- ✅ **Screenshot** - Capture entire screen or regions\r\n- ✅ **Image recognition** - Find elements on screen (via OpenCV)\r\n- ✅ **Color detection** - Get pixel colors at coordinates\r\n- ✅ **Multi-monitor** - Support for multiple displays\r\n\r\n### Window Management\r\n- ✅ **Window list** - Get all open windows\r\n- ✅ **Activate window** - Bring window to front\r\n- ✅ **Window info** - Get position, size, title\r\n- ✅ **Minimize/Maximize** - Control window states\r\n\r\n### Safety Features\r\n- ✅ **Failsafe** - Move mouse to corner to abort\r\n- ✅ **Pause control** - Emergency stop mechanism\r\n- ✅ **Approval mode** - Require confirmation for actions\r\n- ✅ **Bounds checking** - Prevent out-of-screen operations\r\n- ✅ **Logging** - Track all automation actions\r\n\r\n---\r\n\r\n## 🚀 Quick Start\r\n\r\n### Installation\r\n\r\nFirst, install required dependencies:\r\n\r\n```bash\r\npip install pyautogui pillow opencv-python pygetwindow\r\n```\r\n\r\n### Basic Usage\r\n\r\n```python\r\nfrom skills.desktop_control import DesktopController\r\n\r\n# Initialize controller\r\ndc = DesktopController(failsafe=True)\r\n\r\n# Mouse operations\r\ndc.move_mouse(500, 300)  # Move to coordinates\r\ndc.click()  # Left click at current position\r\ndc.click(100, 200, button=\"right\")  # Right click at position\r\n\r\n# Keyboard operations\r\ndc.type_text(\"Hello from OpenClaw!\")\r\ndc.hotkey(\"ctrl\", \"c\")  # Copy\r\ndc.press(\"enter\")\r\n\r\n# Screen operations\r\nscreenshot = dc.screenshot()\r\nposition = dc.get_mouse_position()\r\n```\r\n\r\n---\r\n\r\n## 📋 Complete API Reference\r\n\r\n### Mouse Functions\r\n\r\n#### `move_mouse(x, y, duration=0, smooth=True)`\r\nMove mouse to absolute screen coordinates.\r\n\r\n**Parameters:**\r\n- `x` (int): X coordinate (pixels from left)\r\n- `y` (int): Y coordinate (pixels from top)\r\n- `duration` (float): Movement time in seconds (0 = instant, 0.5 = smooth)\r\n- `smooth` (bool): Use bezier curve for natural movement\r"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7ag28ra4hhta8bx2k2j1kpv180kqbk\",\n  \"slug\": \"desktop-control\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1770255200863\n}"},{"path":"AI_AGENT_GUIDE.md","content":"# AI Desktop Agent - Cognitive Automation Guide\r\n\r\n## 🤖 What Is This?\r\n\r\nThe **AI Desktop Agent** is an intelligent layer on top of the basic desktop control that **understands** what you want and figures out how to do it autonomously.\r\n\r\nUnlike basic automation that requires exact instructions, the AI Agent:\r\n- **Understands natural language** (\"Draw a cat in Paint\")\r\n- **Plans the steps** automatically\r\n- **Executes autonomously** \r\n- **Adapts** based on what it sees\r\n\r\n---\r\n\r\n## 🎯 What Can It Do?\r\n\r\n### ✅ Autonomous Drawing\r\n```python\r\nfrom skills.desktop_control.ai_agent import AIDesktopAgent\r\n\r\nagent = AIDesktopAgent()\r\n\r\n# Just describe what you want!\r\nagent.execute_task(\"Draw a circle in Paint\")\r\nagent.execute_task(\"Draw a star in MS Paint\")\r\nagent.execute_task(\"Draw a house with a sun\")\r\n```\r\n\r\n**What it does:**\r\n1. Opens MS Paint\r\n2. Selects pencil tool\r\n3. Figures out how to draw the requested shape\r\n4. Draws it autonomously\r\n5. Takes a screenshot of the result\r\n\r\n### ✅ Autonomous Text Entry\r\n```python\r\n# It figures out where to type\r\nagent.execute_task(\"Type 'Hello World' in Notepad\")\r\nagent.execute_task(\"Write an email saying thank you\")\r\n```\r\n\r\n**What it does:**\r\n1. Opens Notepad (or finds active text editor)\r\n2. Types the text naturally\r\n3. Formats if needed\r\n\r\n### ✅ Autonomous Application Control\r\n```python\r\n# It knows how to open apps\r\nagent.execute_task(\"Open Calculator\")\r\nagent.execute_task(\"Launch Microsoft Paint\")\r\nagent.execute_task(\"Open File Explorer\")\r\n```\r\n\r\n### ✅ Autonomous Game Playing (Advanced)\r\n```python\r\n# It will try to play the game!\r\nagent.execute_task(\"Play Solitaire for me\")\r\nagent.execute_task(\"Play Minesweeper\")\r\n```\r\n\r\n**What it does:**\r\n1. Analyzes the game screen\r\n2. Detects game state (cards, mines, etc.)\r\n3. Decides best move\r\n4. Executes the move\r\n5. Repeats until win/lose\r\n\r\n---\r\n\r\n## 🏗️ How It Works\r\n\r\n### Architecture\r\n\r\n```\r\nUser Request (\"Draw a cat\")\r\n    ↓\r\nNatural Language Understanding\r\n    ↓\r\nTask Planning (Step-by-step plan)\r\n    ↓\r\nStep Execution Loop:\r\n    - Observe Screen (Computer Vision)\r\n    - Decide Action (AI Reasoning)\r\n    - Execute Action (Desktop Control)\r\n    - Verify Result\r\n    ↓\r\nTask Complete!\r\n```\r\n\r\n### Key Components\r\n\r\n1. **Task Planner** - Breaks down high-level tasks into steps\r\n2. **Vision System** - Understands what's on screen (screenshots, OCR, object detection)\r\n3. **Reasoning Engine** - Decides what to do next\r\n4. **Action Executor** - Performsthe actual mouse/keyboard actions\r\n5. **Feedback Loop** - Verifies actions succeeded\r\n\r\n---\r\n\r\n## 📋 Supported Tasks (Current)\r\n\r\n### Tier 1: Fully Automated ✅\r\n\r\n| Task Pattern | Example | Status |\r\n|-------------|---------|---------|\r\n| Draw shapes in Paint | \"Draw a circle\" | ✅ Working |\r\n| Basic text entry | \"Type Hello\" | ✅ Working |\r\n| Launch applications | \"Open Paint\" | ✅ Working |\r\n\r\n### Tier 2: Partially Automated 🔨\r\n\r\n| Task Pattern | Example | Status |\r\n|-------------|---------|---------|\r\n| Form filling | \"F"},{"path":"QUICK_REFERENCE.md","content":"# Desktop Control - Quick Reference Card\r\n\r\n## 🚀 Instant Start\r\n\r\n```python\r\nfrom skills.desktop_control import DesktopController\r\n\r\ndc = DesktopController()\r\n```\r\n\r\n## 🖱️ Mouse Control (Top 10)\r\n\r\n```python\r\n# 1. Move mouse\r\ndc.move_mouse(500, 300, duration=0.5)\r\n\r\n# 2. Click\r\ndc.click(500, 300)  # Left click at position\r\ndc.click()           # Click at current position\r\n\r\n# 3. Right click\r\ndc.right_click(500, 300)\r\n\r\n# 4. Double click\r\ndc.double_click(500, 300)\r\n\r\n# 5. Drag & drop\r\ndc.drag(100, 100, 500, 500, duration=1.0)\r\n\r\n# 6. Scroll\r\ndc.scroll(-5)  # Scroll down 5 clicks\r\n\r\n# 7. Get position\r\nx, y = dc.get_mouse_position()\r\n\r\n# 8. Move relative\r\ndc.move_relative(100, 50)  # Move 100px right, 50px down\r\n\r\n# 9. Smooth movement\r\ndc.move_mouse(1000, 500, duration=1.0, smooth=True)\r\n\r\n# 10. Middle click\r\ndc.middle_click()\r\n```\r\n\r\n## ⌨️ Keyboard Control (Top 10)\r\n\r\n```python\r\n# 1. Type text (instant)\r\ndc.type_text(\"Hello World\")\r\n\r\n# 2. Type text (human-like, 60 WPM)\r\ndc.type_text(\"Hello World\", wpm=60)\r\n\r\n# 3. Press key\r\ndc.press('enter')\r\ndc.press('tab')\r\ndc.press('escape')\r\n\r\n# 4. Hotkeys (shortcuts)\r\ndc.hotkey('ctrl', 'c')      # Copy\r\ndc.hotkey('ctrl', 'v')      # Paste  \r\ndc.hotkey('ctrl', 's')      # Save\r\ndc.hotkey('win', 'r')       # Run dialog\r\ndc.hotkey('alt', 'tab')     # Switch window\r\n\r\n# 5. Hold & release\r\ndc.key_down('shift')\r\ndc.type_text(\"hello\")  # Types \"HELLO\"\r\ndc.key_up('shift')\r\n\r\n# 6. Arrow keys\r\ndc.press('up')\r\ndc.press('down')\r\ndc.press('left')\r\ndc.press('right')\r\n\r\n# 7. Function keys\r\ndc.press('f5')  # Refresh\r\n\r\n# 8. Multiple presses\r\ndc.press('backspace', presses=5)\r\n\r\n# 9. Special keys\r\ndc.press('home')\r\ndc.press('end')\r\ndc.press('pagedown')\r\ndc.press('delete')\r\n\r\n# 10. Fast combo\r\ndc.hotkey('ctrl', 'alt', 'delete')\r\n```\r\n\r\n## 📸 Screen Operations (Top 5)\r\n\r\n```python\r\n# 1. Screenshot (full screen)\r\nimg = dc.screenshot()\r\ndc.screenshot(filename=\"screen.png\")\r\n\r\n# 2. Screenshot (region)\r\nimg = dc.screenshot(region=(100, 100, 800, 600))\r\n\r\n# 3. Get pixel color\r\nr, g, b = dc.get_pixel_color(500, 300)\r\n\r\n# 4. Find image on screen\r\nlocation = dc.find_on_screen(\"button.png\")\r\n\r\n# 5. Get screen size\r\nwidth, height = dc.get_screen_size()\r\n```\r\n\r\n## 🪟 Window Management (Top 5)\r\n\r\n```python\r\n# 1. Get all windows\r\nwindows = dc.get_all_windows()\r\n\r\n# 2. Activate window\r\ndc.activate_window(\"Chrome\")\r\n\r\n# 3. Get active window\r\nactive = dc.get_active_window()\r\n\r\n# 4. List windows\r\nfor title in dc.get_all_windows():\r\n    print(title)\r\n\r\n# 5. Switch to app\r\ndc.activate_window(\"Visual Studio Code\")\r\n```\r\n\r\n## 📋 Clipboard (Top 2)\r\n\r\n```python\r\n# 1. Copy to clipboard\r\ndc.copy_to_clipboard(\"Hello!\")\r\n\r\n# 2. Get from clipboard\r\ntext = dc.get_from_clipboard()\r\n```\r\n\r\n## 🔥 Real-World Examples\r\n\r\n### Example 1: Auto-fill Form\r\n```python\r\ndc.click(300, 200)  # Name field\r\ndc.type_text(\"John Doe\", wpm=80)\r\ndc.press('tab')\r\ndc.type_text(\"john@email.com\", wpm=80)\r\ndc.press('tab')\r\ndc.type_text(\"Password123\", wpm=60)\r\ndc.press('enter')\r\n```"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Advanced desktop automation with mouse, keyboard, and screen control Skill: Desktop Control Owner: matagul Summary: Advanced desktop automation with mouse, keyboard, and screen control Tags: latest:1.0.0 Version history: v1.0.0 | 2026-02-05T01:33:20.863Z | auto Version 1.0.0 - Initial release of the Desktop Control skill for OpenClaw. - Provides advanced automation: mouse movement/clicks, keyboard input, hotkeys, and typing speed control. - Supports screen capture, region-based screen","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":966,"uniquenessScore":56,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-05-21T06:30:40.139Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-05-21T06:30:40.139Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T10:00:34.306Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}