[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7809H3MBQJ688SDCVQPSY6Z":3,"skill-same:01M7809H3MBQJ688SDCVQPSY6Z":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M7809H3MBQJ688SDCVQPSY6Z","desktop-control",null,"Advanced desktop automation with mouse, keyboard, and screen control","HKU-MMLab\u002FUniClawBench","HKU-MMLab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F218629317?v=4","01M7808YETMPBKR5WJNJRFSCDJ","01M7808YFS0WMXB5QAF8YG01BA",40,"MIT","https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Fdocker\u002Fbase_skills\u002Fdesktop-control\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: Advanced desktop automation with mouse, keyboard, and screen control\n---\n\n# Desktop Control Skill\n\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.\n\n## 🎯 Features\n\n### Mouse Control\n- ✅ **Absolute positioning** - Move to exact coordinates\n- ✅ **Relative movement** - Move from current position\n- ✅ **Smooth movement** - Natural, human-like mouse paths\n- ✅ **Click types** - Left, right, middle, double, triple clicks\n- ✅ **Drag & drop** - Drag from point A to point B\n- ✅ **Scroll** - Vertical and horizontal scrolling\n- ✅ **Position tracking** - Get current mouse coordinates\n\n### Keyboard Control\n- ✅ **Text typing** - Fast, accurate text input\n- ✅ **Hotkeys** - Execute keyboard shortcuts (Ctrl+C, Win+R, etc.)\n- ✅ **Special keys** - Enter, Tab, Escape, Arrow keys, F-keys\n- ✅ **Key combinations** - Multi-key press combinations\n- ✅ **Hold & release** - Manual key state control\n- ✅ **Typing speed** - Configurable WPM (instant to human-like)\n\n### Screen Operations\n- ✅ **Screenshot** - Capture entire screen or regions\n- ✅ **Image recognition** - Find elements on screen (via OpenCV)\n- ✅ **Color detection** - Get pixel colors at coordinates\n- ✅ **Multi-monitor** - Support for multiple displays\n\n### Window Management\n- ✅ **Window list** - Get all open windows\n- ✅ **Activate window** - Bring window to front\n- ✅ **Window info** - Get position, size, title\n- ✅ **Minimize\u002FMaximize** - Control window states\n\n### Safety Features\n- ✅ **Failsafe** - Move mouse to corner to abort\n- ✅ **Pause control** - Emergency stop mechanism\n- ✅ **Approval mode** - Require confirmation for actions\n- ✅ **Bounds checking** - Prevent out-of-screen operations\n- ✅ **Logging** - Track all automation actions\n\n---\n\n## 🚀 Quick Start\n\n### Installation\n\nFirst, install required dependencies:\n\n```bash\npip install pyautogui pillow opencv-python pygetwindow\n```\n\n### Basic Usage\n\n```python\nfrom skills.desktop_control import DesktopController\n\n# Initialize controller\ndc = DesktopController(failsafe=True)\n\n# Mouse operations\ndc.move_mouse(500, 300)  # Move to coordinates\ndc.click()  # Left click at current position\ndc.click(100, 200, button=\"right\")  # Right click at position\n\n# Keyboard operations\ndc.type_text(\"Hello from OpenClaw!\")\ndc.hotkey(\"ctrl\", \"c\")  # Copy\ndc.press(\"enter\")\n\n# Screen operations\nscreenshot = dc.screenshot()\nposition = dc.get_mouse_position()\n```\n\n---\n\n## 📋 Complete API Reference\n\n### Mouse Functions\n\n#### `move_mouse(x, y, duration=0, smooth=True)`\nMove mouse to absolute screen coordinates.\n\n**Parameters:**\n- `x` (int): X coordinate (pixels from left)\n- `y` (int): Y coordinate (pixels from top)\n- `duration` (float): Movement time in seconds (0 = instant, 0.5 = smooth)\n- `smooth` (bool): Use bezier curve for natural movement\n\n**Example:**\n```python\n# Instant movement\ndc.move_mouse(1000, 500)\n\n# Smooth 1-second movement\ndc.move_mouse(1000, 500, duration=1.0)\n```\n\n#### `move_relative(x_offset, y_offset, duration=0)`\nMove mouse relative to current position.\n\n**Parameters:**\n- `x_offset` (int): Pixels to move horizontally (positive = right)\n- `y_offset` (int): Pixels to move vertically (positive = down)\n- `duration` (float): Movement time in seconds\n\n**Example:**\n```python\n# Move 100px right, 50px down\ndc.move_relative(100, 50, duration=0.3)\n```\n\n#### `click(x=None, y=None, button='left', clicks=1, interval=0.1)`\nPerform mouse click.\n\n**Parameters:**\n- `x, y` (int, optional): Coordinates to click (None = current position)\n- `button` (str): 'left', 'right', 'middle'\n- `clicks` (int): Number of clicks (1 = single, 2 = double)\n- `interval` (float): Delay between multiple clicks\n\n**Example:**\n```python\n# Simple left click\ndc.click()\n\n# Double-click at specific position\ndc.click(500, 300, clicks=2)\n\n# Right-click\ndc.click(button='right')\n```\n\n#### `drag(start_x, start_y, end_x, end_y, duration=0.5, button='left')`\nDrag and drop operation.\n\n**Parameters:**\n- `start_x, start_y` (int): Starting coordinates\n- `end_x, end_y` (int): Ending coordinates\n- `duration` (float): Drag duration\n- `button` (str): Mouse button to use\n\n**Example:**\n```python\n# Drag file from desktop to folder\ndc.drag(100, 100, 500, 500, duration=1.0)\n```\n\n#### `scroll(clicks, direction='vertical', x=None, y=None)`\nScroll mouse wheel.\n\n**Parameters:**\n- `clicks` (int): Scroll amount (positive = up\u002Fleft, negative = down\u002Fright)\n- `direction` (str): 'vertical' or 'horizontal'\n- `x, y` (int, optional): Position to scroll at\n\n**Example:**\n```python\n# Scroll down 5 clicks\ndc.scroll(-5)\n\n# Scroll up 10 clicks\ndc.scroll(10)\n\n# Horizontal scroll\ndc.scroll(5, direction='horizontal')\n```\n\n#### `get_mouse_position()`\nGet current mouse coordinates.\n\n**Returns:** `(x, y)` tuple\n\n**Example:**\n```python\nx, y = dc.get_mouse_position()\nprint(f\"Mouse is at: {x}, {y}\")\n```\n\n---\n\n### Keyboard Functions\n\n#### `type_text(text, interval=0, wpm=None)`\nType text with configurable speed.\n\n**Parameters:**\n- `text` (str): Text to type\n- `interval` (float): Delay between keystrokes (0 = instant)\n- `wpm` (int, optional): Words per minute (overrides interval)\n\n**Example:**\n```python\n# Instant typing\ndc.type_text(\"Hello World\")\n\n# Human-like typing at 60 WPM\ndc.type_text(\"Hello World\", wpm=60)\n\n# Slow typing with 0.1s between keys\ndc.type_text(\"Hello World\", interval=0.1)\n```\n\n#### `press(key, presses=1, interval=0.1)`\nPress and release a key.\n\n**Parameters:**\n- `key` (str): Key name (see Key Names section)\n- `presses` (int): Number of times to press\n- `interval` (float): Delay between presses\n\n**Example:**\n```python\n# Press Enter\ndc.press('enter')\n\n# Press Space 3 times\ndc.press('space', presses=3)\n\n# Press Down arrow\ndc.press('down')\n```\n\n#### `hotkey(*keys, interval=0.05)`\nExecute keyboard shortcut.\n\n**Parameters:**\n- `*keys` (str): Keys to press together\n- `interval` (float): Delay between key presses\n\n**Example:**\n```python\n# Copy (Ctrl+C)\ndc.hotkey('ctrl', 'c')\n\n# Paste (Ctrl+V)\ndc.hotkey('ctrl', 'v')\n\n# Open Run dialog (Win+R)\ndc.hotkey('win', 'r')\n\n# Save (Ctrl+S)\ndc.hotkey('ctrl', 's')\n\n# Select All (Ctrl+A)\ndc.hotkey('ctrl', 'a')\n```\n\n#### `key_down(key)` \u002F `key_up(key)`\nManually control key state.\n\n**Example:**\n```python\n# Hold Shift\ndc.key_down('shift')\ndc.type_text(\"hello\")  # Types \"HELLO\"\ndc.key_up('shift')\n\n# Hold Ctrl and click (for multi-select)\ndc.key_down('ctrl')\ndc.click(100, 100)\ndc.click(200, 100)\ndc.key_up('ctrl')\n```\n\n---\n\n### Screen Functions\n\n#### `screenshot(region=None, filename=None)`\nCapture screen or region.\n\n**Parameters:**\n- `region` (tuple, optional): (left, top, width, height) for partial capture\n- `filename` (str, optional): Path to save image\n\n**Returns:** PIL Image object\n\n**Example:**\n```python\n# Full screen\nimg = dc.screenshot()\n\n# Save to file\ndc.screenshot(filename=\"screenshot.png\")\n\n# Capture specific region\nimg = dc.screenshot(region=(100, 100, 500, 300))\n```\n\n#### `get_pixel_color(x, y)`\nGet color of pixel at coordinates.\n\n**Returns:** RGB tuple `(r, g, b)`\n\n**Example:**\n```python\nr, g, b = dc.get_pixel_color(500, 300)\nprint(f\"Color at (500, 300): RGB({r}, {g}, {b})\")\n```\n\n#### `find_on_screen(image_path, confidence=0.8)`\nFind image on screen (requires OpenCV).\n\n**Parameters:**\n- `image_path` (str): Path to template image\n- `confidence` (float): Match threshold (0-1)\n\n**Returns:** `(x, y, width, height)` or None\n\n**Example:**\n```python\n# Find button on screen\nlocation = dc.find_on_screen(\"button.png\")\nif location:\n    x, y, w, h = location\n    # Click center of found image\n    dc.click(x + w\u002F\u002F2, y + h\u002F\u002F2)\n```\n\n#### `get_screen_size()`\nGet screen resolution.\n\n**Returns:** `(width, height)` tuple\n\n**Example:**\n```python\nwidth, height = dc.get_screen_size()\nprint(f\"Screen: {width}x{height}\")\n```\n\n---\n\n### Window Functions\n\n#### `get_all_windows()`\nList all open windows.\n\n**Returns:** List of window titles\n\n**Example:**\n```python\nwindows = dc.get_all_windows()\nfor title in windows:\n    print(f\"Window: {title}\")\n```\n\n#### `activate_window(title_substring)`\nBring window to front by title.\n\n**Parameters:**\n- `title_substring` (str): Part of window title to match\n\n**Example:**\n```python\n# Activate Chrome\ndc.activate_window(\"Chrome\")\n\n# Activate VS Code\ndc.activate_window(\"Visual Studio Code\")\n```\n\n#### `get_active_window()`\nGet currently focused window.\n\n**Returns:** Window title (str)\n\n**Example:**\n```python\nactive = dc.get_active_window()\nprint(f\"Active window: {active}\")\n```\n\n---\n\n### Clipboard Functions\n\n#### `copy_to_clipboard(text)`\nCopy text to clipboard.\n\n**Example:**\n```python\ndc.copy_to_clipboard(\"Hello from OpenClaw!\")\n```\n\n#### `get_from_clipboard()`\nGet text from clipboard.\n\n**Returns:** str\n\n**Example:**\n```python\ntext = dc.get_from_clipboard()\nprint(f\"Clipboard: {text}\")\n```\n\n---\n\n## ⌨️ Key Names Reference\n\n### Alphabet Keys\n`'a'` through `'z'`\n\n### Number Keys\n`'0'` through `'9'`\n\n### Function Keys\n`'f1'` through `'f24'`\n\n### Special Keys\n- `'enter'` \u002F `'return'`\n- `'esc'` \u002F `'escape'`\n- `'space'` \u002F `'spacebar'`\n- `'tab'`\n- `'backspace'`\n- `'delete'` \u002F `'del'`\n- `'insert'`\n- `'home'`\n- `'end'`\n- `'pageup'` \u002F `'pgup'`\n- `'pagedown'` \u002F `'pgdn'`\n\n### Arrow Keys\n- `'up'` \u002F `'down'` \u002F `'left'` \u002F `'right'`\n\n### Modifier Keys\n- `'ctrl'` \u002F `'control'`\n- `'shift'`\n- `'alt'`\n- `'win'` \u002F `'winleft'` \u002F `'winright'`\n- `'cmd'` \u002F `'command'` (Mac)\n\n### Lock Keys\n- `'capslock'`\n- `'numlock'`\n- `'scrolllock'`\n\n### Punctuation\n- `'.'` \u002F `','` \u002F `'?'` \u002F `'!'` \u002F `';'` \u002F `':'`\n- `'['` \u002F `']'` \u002F `'{'` \u002F `'}'`\n- `'('` \u002F `')'`\n- `'+'` \u002F `'-'` \u002F `'*'` \u002F `'\u002F'` \u002F `'='`\n\n---\n\n## 🛡️ Safety Features\n\n### Failsafe Mode\n\nMove mouse to **any corner** of the screen to abort all automation.\n\n```python\n# Enable failsafe (enabled by default)\ndc = DesktopController(failsafe=True)\n```\n\n### Pause Control\n\n```python\n# Pause all automation for 2 seconds\ndc.pause(2.0)\n\n# Check if automation is safe to proceed\nif dc.is_safe():\n    dc.click(500, 500)\n```\n\n### Approval Mode\n\nRequire user confirmation before actions:\n\n```python\ndc = DesktopController(require_approval=True)\n\n# This will ask for confirmation\ndc.click(500, 500)  # Prompt: \"Allow click at (500, 500)? [y\u002Fn]\"\n```\n\n---\n\n## 🎨 Advanced Examples\n\n### Example 1: Automated Form Filling\n\n```python\ndc = DesktopController()\n\n# Click name field\ndc.click(300, 200)\ndc.type_text(\"John Doe\", wpm=80)\n\n# Tab to next field\ndc.press('tab')\ndc.type_text(\"john@example.com\", wpm=80)\n\n# Tab to password\ndc.press('tab')\ndc.type_text(\"SecurePassword123\", wpm=60)\n\n# Submit form\ndc.press('enter')\n```\n\n### Example 2: Screenshot Region and Save\n\n```python\n# Capture specific area\nregion = (100, 100, 800, 600)  # left, top, width, height\nimg = dc.screenshot(region=region)\n\n# Save with timestamp\nimport datetime\ntimestamp = datetime.datetime.now().strftime(\"%Y%m%d_%H%M%S\")\nimg.save(f\"capture_{timestamp}.png\")\n```\n\n### Example 3: Multi-File Selection\n\n```python\n# Hold Ctrl and click multiple files\ndc.key_down('ctrl')\ndc.click(100, 200)  # First file\ndc.click(100, 250)  # Second file\ndc.click(100, 300)  # Third file\ndc.key_up('ctrl')\n\n# Copy selected files\ndc.hotkey('ctrl', 'c')\n```\n\n### Example 4: Window Automation\n\n```python\n# Activate Calculator\ndc.activate_window(\"Calculator\")\ntime.sleep(0.5)\n\n# Type calculation\ndc.type_text(\"5+3=\", interval=0.2)\ntime.sleep(0.5)\n\n# Take screenshot of result\ndc.screenshot(filename=\"calculation_result.png\")\n```\n\n### Example 5: Drag & Drop File\n\n```python\n# Drag file from source to destination\ndc.drag(\n    start_x=200, start_y=300,  # File location\n    end_x=800, end_y=500,       # Folder location\n    duration=1.0                 # Smooth 1-second drag\n)\n```\n\n---\n\n## ⚡ Performance Tips\n\n1. **Use instant movements** for speed: `duration=0`\n2. **Batch operations** instead of individual calls\n3. **Cache screen positions** instead of recalculating\n4. **Disable failsafe** for maximum performance (use with caution)\n5. **Use hotkeys** instead of menu navigation\n\n---\n\n## ⚠️ Important Notes\n\n- **Screen coordinates** start at (0, 0) in top-left corner\n- **Multi-monitor setups** may have negative coordinates for secondary displays\n- **Windows DPI scaling** may affect coordinate accuracy\n- **Failsafe corners** are: (0,0), (width-1, 0), (0, height-1), (width-1, height-1)\n- **Some applications** may block simulated input (games, secure apps)\n\n---\n\n## 🔧 Troubleshooting\n\n### Mouse not moving to correct position\n- Check DPI scaling settings\n- Verify screen resolution matches expectations\n- Use `get_screen_size()` to confirm dimensions\n\n### Keyboard input not working\n- Ensure target application has focus\n- Some apps require admin privileges\n- Try increasing `interval` for reliability\n\n### Failsafe triggering accidentally\n- Increase screen border tolerance\n- Move mouse away from corners during normal use\n- Disable if needed: `DesktopController(failsafe=False)`\n\n### Permission errors\n- Run Python with administrator privileges for some operations\n- Some secure applications block automation\n\n---\n\n## 📦 Dependencies\n\n- **PyAutoGUI** - Core automation engine\n- **Pillow** - Image processing\n- **OpenCV** (optional) - Image recognition\n- **PyGetWindow** - Window management\n\nInstall all:\n```bash\npip install pyautogui pillow opencv-python pygetwindow\n```\n\n---\n\n**Built for OpenClaw** - The ultimate desktop automation companion 🦞\n","# Desktop Control Skill\n\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.\n\n## 🎯 Features\n\n### Mouse Control\n- ✅ **Absolute positioning** - Move to exact coordinates\n- ✅ **Relative movement** - Move from current position\n- ✅ **Smooth movement** - Natural, human-like mouse paths\n- ✅ **Click types** - Left, right, middle, double, triple clicks\n- ✅ **Drag & drop** - Drag from point A to point B\n- ✅ **Scroll** - Vertical and horizontal scrolling\n- ✅ **Position tracking** - Get current mouse coordinates\n\n### Keyboard Control\n- ✅ **Text typing** - Fast, accurate text input\n- ✅ **Hotkeys** - Execute keyboard shortcuts (Ctrl+C, Win+R, etc.)\n- ✅ **Special keys** - Enter, Tab, Escape, Arrow keys, F-keys\n- ✅ **Key combinations** - Multi-key press combinations\n- ✅ **Hold & release** - Manual key state control\n- ✅ **Typing speed** - Configurable WPM (instant to human-like)\n\n### Screen Operations\n- ✅ **Screenshot** - Capture entire screen or regions\n- ✅ **Image recognition** - Find elements on screen (via OpenCV)\n- ✅ **Color detection** - Get pixel colors at coordinates\n- ✅ **Multi-monitor** - Support for multiple displays\n\n### Window Management\n- ✅ **Window list** - Get all open windows\n- ✅ **Activate window** - Bring window to front\n- ✅ **Window info** - Get position, size, title\n- ✅ **Minimize\u002FMaximize** - Control window states\n\n### Safety Features\n- ✅ **Failsafe** - Move mouse to corner to abort\n- ✅ **Pause control** - Emergency stop mechanism\n- ✅ **Approval mode** - Require confirmation for actions\n- ✅ **Bounds checking** - Prevent out-of-screen operations\n- ✅ **Logging** - Track all automation actions\n\n---\n\n## 🚀 Quick Start\n\n### Installation\n\nFirst, install required dependencies:\n\n```bash\npip install pyautogui pillow opencv-python pygetwindow\n```\n\n### Basic Usage\n\n```python\nfrom skills.desktop_control import DesktopController\n\n# Initialize controller\ndc = DesktopController(failsafe=True)\n\n# Mouse operations\ndc.move_mouse(500, 300)  # Move to coordinates\ndc.click()  # Left click at current position\ndc.click(100, 200, button=\"right\")  # Right click at position\n\n# Keyboard operations\ndc.type_text(\"Hello from OpenClaw!\")\ndc.hotkey(\"ctrl\", \"c\")  # Copy\ndc.press(\"enter\")\n\n# Screen operations\nscreenshot = dc.screenshot()\nposition = dc.get_mouse_position()\n```\n\n---\n\n## 📋 Complete API Reference\n\n### Mouse Functions\n\n#### `move_mouse(x, y, duration=0, smooth=True)`\nMove mouse to absolute screen coordinates.\n\n**Parameters:**\n- `x` (int): X coordinate (pixels from left)\n- `y` (int): Y coordinate (pixels from top)\n- `duration` (float): Movement time in seconds (0 = instant, 0.5 = smooth)\n- `smooth` (bool): Use bezier curve for natural movement\n\n**Example:**\n```python\n# Instant movement\ndc.move_mouse(1000, 500)\n\n# Smooth 1-second movement\ndc.move_mouse(1000, 500, duration=1.0)\n```\n\n#### `move_relative(x_offset, y_offset, duration=0)`\nMove mouse relative to current position.\n\n**Parameters:**\n- `x_offset` (int): Pixels to move horizontally (positive = right)\n- `y_offset` (int): Pixels to move vertically (positive = down)\n- `duration` (float): Movement time in seconds\n\n**Example:**\n```python\n# Move 100px right, 50px down\ndc.move_relative(100, 50, duration=0.3)\n```\n\n#### `click(x=None, y=None, button='left', clicks=1, interval=0.1)`\nPerform mouse click.\n\n**Parameters:**\n- `x, y` (int, optional): Coordinates to click (None = current position)\n- `button` (str): 'left', 'right', 'middle'\n- `clicks` (int): Number of clicks (1 = single, 2 = double)\n- `interval` (float): Delay between multiple clicks\n\n**Example:**\n```python\n# Simple left click\ndc.click()\n\n# Double-click at specific position\ndc.click(500, 300, clicks=2)\n\n# Right-click\ndc.click(button='right')\n```\n\n#### `drag(start_x, start_y, end_x, end_y, duration=0.5, button='left')`\nDrag and drop operation.\n\n**Parameters:**\n- `start_x, start_y` (int): Starting coordinates\n- `end_x, end_y` (int): Ending coordinates\n- `duration` (float): Drag duration\n- `button` (str): Mouse button to use\n\n**Example:**\n```python\n# Drag file from desktop to folder\ndc.drag(100, 100, 500, 500, duration=1.0)\n```\n\n#### `scroll(clicks, direction='vertical', x=None, y=None)`\nScroll mouse wheel.\n\n**Parameters:**\n- `clicks` (int): Scroll amount (positive = up\u002Fleft, negative = down\u002Fright)\n- `direction` (str): 'vertical' or 'horizontal'\n- `x, y` (int, optional): Position to scroll at\n\n**Example:**\n```python\n# Scroll down 5 clicks\ndc.scroll(-5)\n\n# Scroll up 10 clicks\ndc.scroll(10)\n\n# Horizontal scroll\ndc.scroll(5, direction='horizontal')\n```\n\n#### `get_mouse_position()`\nGet current mouse coordinates.\n\n**Returns:** `(x, y)` tuple\n\n**Example:**\n```python\nx, y = dc.get_mouse_position()\nprint(f\"Mouse is at: {x}, {y}\")\n```\n\n---\n\n### Keyboard Functions\n\n#### `type_text(text, interval=0, wpm=None)`\nType text with configurable speed.\n\n**Parameters:**\n- `text` (str): Text to type\n- `interval` (float): Delay between keystrokes (0 = instant)\n- `wpm` (int, optional): Words per minute (overrides interval)\n\n**Example:**\n```python\n# Instant typing\ndc.type_text(\"Hello World\")\n\n# Human-like typing at 60 WPM\ndc.type_text(\"Hello World\", wpm=60)\n\n# Slow typing with 0.1s between keys\ndc.type_text(\"Hello World\", interval=0.1)\n```\n\n#### `press(key, presses=1, interval=0.1)`\nPress and release a key.\n\n**Parameters:**\n- `key` (str): Key name (see Key Names section)\n- `presses` (int): Number of times to press\n- `interval` (float): Delay between presses\n\n**Example:**\n```python\n# Press Enter\ndc.press('enter')\n\n# Press Space 3 times\ndc.press('space', presses=3)\n\n# Press Down arrow\ndc.press('down')\n```\n\n#### `hotkey(*keys, interval=0.05)`\nExecute keyboard shortcut.\n\n**Parameters:**\n- `*keys` (str): Keys to press together\n- `interval` (float): Delay between key presses\n\n**Example:**\n```python\n# Copy (Ctrl+C)\ndc.hotkey('ctrl', 'c')\n\n# Paste (Ctrl+V)\ndc.hotkey('ctrl', 'v')\n\n# Open Run dialog (Win+R)\ndc.hotkey('win', 'r')\n\n# Save (Ctrl+S)\ndc.hotkey('ctrl', 's')\n\n# Select All (Ctrl+A)\ndc.hotkey('ctrl', 'a')\n```\n\n#### `key_down(key)` \u002F `key_up(key)`\nManually control key state.\n\n**Example:**\n```python\n# Hold Shift\ndc.key_down('shift')\ndc.type_text(\"hello\")  # Types \"HELLO\"\ndc.key_up('shift')\n\n# Hold Ctrl and click (for multi-select)\ndc.key_down('ctrl')\ndc.click(100, 100)\ndc.click(200, 100)\ndc.key_up('ctrl')\n```\n\n---\n\n### Screen Functions\n\n#### `screenshot(region=None, filename=None)`\nCapture screen or region.\n\n**Parameters:**\n- `region` (tuple, optional): (left, top, width, height) for partial capture\n- `filename` (str, optional): Path to save image\n\n**Returns:** PIL Image object\n\n**Example:**\n```python\n# Full screen\nimg = dc.screenshot()\n\n# Save to file\ndc.screenshot(filename=\"screenshot.png\")\n\n# Capture specific region\nimg = dc.screenshot(region=(100, 100, 500, 300))\n```\n\n#### `get_pixel_color(x, y)`\nGet color of pixel at coordinates.\n\n**Returns:** RGB tuple `(r, g, b)`\n\n**Example:**\n```python\nr, g, b = dc.get_pixel_color(500, 300)\nprint(f\"Color at (500, 300): RGB({r}, {g}, {b})\")\n```\n\n#### `find_on_screen(image_path, confidence=0.8)`\nFind image on screen (requires OpenCV).\n\n**Parameters:**\n- `image_path` (str): Path to template image\n- `confidence` (float): Match threshold (0-1)\n\n**Returns:** `(x, y, width, height)` or None\n\n**Example:**\n```python\n# Find button on screen\nlocation = dc.find_on_screen(\"button.png\")\nif location:\n    x, y, w, h = location\n    # Click center of found image\n    dc.click(x + w\u002F\u002F2, y + h\u002F\u002F2)\n```\n\n#### `get_screen_size()`\nGet screen resolution.\n\n**Returns:** `(width, height)` tuple\n\n**Example:**\n```python\nwidth, height = dc.get_screen_size()\nprint(f\"Screen: {width}x{height}\")\n```\n\n---\n\n### Window Functions\n\n#### `get_all_windows()`\nList all open windows.\n\n**Returns:** List of window titles\n\n**Example:**\n```python\nwindows = dc.get_all_windows()\nfor title in windows:\n    print(f\"Window: {title}\")\n```\n\n#### `activate_window(title_substring)`\nBring window to front by title.\n\n**Parameters:**\n- `title_substring` (str): Part of window title to match\n\n**Example:**\n```python\n# Activate Chrome\ndc.activate_window(\"Chrome\")\n\n# Activate VS Code\ndc.activate_window(\"Visual Studio Code\")\n```\n\n#### `get_active_window()`\nGet currently focused window.\n\n**Returns:** Window title (str)\n\n**Example:**\n```python\nactive = dc.get_active_window()\nprint(f\"Active window: {active}\")\n```\n\n---\n\n### Clipboard Functions\n\n#### `copy_to_clipboard(text)`\nCopy text to clipboard.\n\n**Example:**\n```python\ndc.copy_to_clipboard(\"Hello from OpenClaw!\")\n```\n\n#### `get_from_clipboard()`\nGet text from clipboard.\n\n**Returns:** str\n\n**Example:**\n```python\ntext = dc.get_from_clipboard()\nprint(f\"Clipboard: {text}\")\n```\n\n---\n\n## ⌨️ Key Names Reference\n\n### Alphabet Keys\n`'a'` through `'z'`\n\n### Number Keys\n`'0'` through `'9'`\n\n### Function Keys\n`'f1'` through `'f24'`\n\n### Special Keys\n- `'enter'` \u002F `'return'`\n- `'esc'` \u002F `'escape'`\n- `'space'` \u002F `'spacebar'`\n- `'tab'`\n- `'backspace'`\n- `'delete'` \u002F `'del'`\n- `'insert'`\n- `'home'`\n- `'end'`\n- `'pageup'` \u002F `'pgup'`\n- `'pagedown'` \u002F `'pgdn'`\n\n### Arrow Keys\n- `'up'` \u002F `'down'` \u002F `'left'` \u002F `'right'`\n\n### Modifier Keys\n- `'ctrl'` \u002F `'control'`\n- `'shift'`\n- `'alt'`\n- `'win'` \u002F `'winleft'` \u002F `'winright'`\n- `'cmd'` \u002F `'command'` (Mac)\n\n### Lock Keys\n- `'capslock'`\n- `'numlock'`\n- `'scrolllock'`\n\n### Punctuation\n- `'.'` \u002F `','` \u002F `'?'` \u002F `'!'` \u002F `';'` \u002F `':'`\n- `'['` \u002F `']'` \u002F `'{'` \u002F `'}'`\n- `'('` \u002F `')'`\n- `'+'` \u002F `'-'` \u002F `'*'` \u002F `'\u002F'` \u002F `'='`\n\n---\n\n## 🛡️ Safety Features\n\n### Failsafe Mode\n\nMove mouse to **any corner** of the screen to abort all automation.\n\n```python\n# Enable failsafe (enabled by default)\ndc = DesktopController(failsafe=True)\n```\n\n### Pause Control\n\n```python\n# Pause all automation for 2 seconds\ndc.pause(2.0)\n\n# Check if automation is safe to proceed\nif dc.is_safe():\n    dc.click(500, 500)\n```\n\n### Approval Mode\n\nRequire user confirmation before actions:\n\n```python\ndc = DesktopController(require_approval=True)\n\n# This will ask for confirmation\ndc.click(500, 500)  # Prompt: \"Allow click at (500, 500)? [y\u002Fn]\"\n```\n\n---\n\n## 🎨 Advanced Examples\n\n### Example 1: Automated Form Filling\n\n```python\ndc = DesktopController()\n\n# Click name field\ndc.click(300, 200)\ndc.type_text(\"John Doe\", wpm=80)\n\n# Tab to next field\ndc.press('tab')\ndc.type_text(\"john@example.com\", wpm=80)\n\n# Tab to password\ndc.press('tab')\ndc.type_text(\"SecurePassword123\", wpm=60)\n\n# Submit form\ndc.press('enter')\n```\n\n### Example 2: Screenshot Region and Save\n\n```python\n# Capture specific area\nregion = (100, 100, 800, 600)  # left, top, width, height\nimg = dc.screenshot(region=region)\n\n# Save with timestamp\nimport datetime\ntimestamp = datetime.datetime.now().strftime(\"%Y%m%d_%H%M%S\")\nimg.save(f\"capture_{timestamp}.png\")\n```\n\n### Example 3: Multi-File Selection\n\n```python\n# Hold Ctrl and click multiple files\ndc.key_down('ctrl')\ndc.click(100, 200)  # First file\ndc.click(100, 250)  # Second file\ndc.click(100, 300)  # Third file\ndc.key_up('ctrl')\n\n# Copy selected files\ndc.hotkey('ctrl', 'c')\n```\n\n### Example 4: Window Automation\n\n```python\n# Activate Calculator\ndc.activate_window(\"Calculator\")\ntime.sleep(0.5)\n\n# Type calculation\ndc.type_text(\"5+3=\", interval=0.2)\ntime.sleep(0.5)\n\n# Take screenshot of result\ndc.screenshot(filename=\"calculation_result.png\")\n```\n\n### Example 5: Drag & Drop File\n\n```python\n# Drag file from source to destination\ndc.drag(\n    start_x=200, start_y=300,  # File location\n    end_x=800, end_y=500,       # Folder location\n    duration=1.0                 # Smooth 1-second drag\n)\n```\n\n---\n\n## ⚡ Performance Tips\n\n1. **Use instant movements** for speed: `duration=0`\n2. **Batch operations** instead of individual calls\n3. **Cache screen positions** instead of recalculating\n4. **Disable failsafe** for maximum performance (use with caution)\n5. **Use hotkeys** instead of menu navigation\n\n---\n\n## ⚠️ Important Notes\n\n- **Screen coordinates** start at (0, 0) in top-left corner\n- **Multi-monitor setups** may have negative coordinates for secondary displays\n- **Windows DPI scaling** may affect coordinate accuracy\n- **Failsafe corners** are: (0,0), (width-1, 0), (0, height-1), (width-1, height-1)\n- **Some applications** may block simulated input (games, secure apps)\n\n---\n\n## 🔧 Troubleshooting\n\n### Mouse not moving to correct position\n- Check DPI scaling settings\n- Verify screen resolution matches expectations\n- Use `get_screen_size()` to confirm dimensions\n\n### Keyboard input not working\n- Ensure target application has focus\n- Some apps require admin privileges\n- Try increasing `interval` for reliability\n\n### Failsafe triggering accidentally\n- Increase screen border tolerance\n- Move mouse away from corners during normal use\n- Disable if needed: `DesktopController(failsafe=False)`\n\n### Permission errors\n- Run Python with administrator privileges for some operations\n- Some secure applications block automation\n\n---\n\n## 📦 Dependencies\n\n- **PyAutoGUI** - Core automation engine\n- **Pillow** - Image processing\n- **OpenCV** (optional) - Image recognition\n- **PyGetWindow** - Window management\n\nInstall all:\n```bash\npip install pyautogui pillow opencv-python pygetwindow\n```\n\n---\n\n**Built for OpenClaw** - The ultimate desktop automation companion 🦞\n",{"description":7},"main","a8ac4df6c554178c339f42696e3afe688a61f4b7","docker\u002Fbase_skills\u002Fdesktop-control",1,"https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench","https:\u002F\u002Fgithub.com\u002FHKU-MMLab","Multimedia Lab at The University of Hong Kong, a top-notch research cohort dedicated to research and educating the best minds.","2026-07-28 16:29:51",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add HKU-MMLab\u002FUniClawBench --skill desktop-control",{"tool":37,"command":38},"bunx","bunx skills add HKU-MMLab\u002FUniClawBench --skill desktop-control",{"tool":40,"command":41},"pnpm","pnpm dlx skills add HKU-MMLab\u002FUniClawBench --skill desktop-control","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Fdocker\u002Fbase_skills\u002Fdesktop-control\u002FSKILL.md",true,[45,51,57,61,65,69],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"__init__.py","SCRIPT","脚本",18283,"https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Fdocker\u002Fbase_skills\u002Fdesktop-control\u002F__init__.py",{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"_meta.json","REFERENCE","参考文档",134,"https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Fdocker\u002Fbase_skills\u002Fdesktop-control\u002F_meta.json",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"AI_AGENT_GUIDE.md",10603,"https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Fdocker\u002Fbase_skills\u002Fdesktop-control\u002FAI_AGENT_GUIDE.md",{"path":62,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":63,"sourceHtmlUrl":64},"ai_agent.py",20849,"https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Fdocker\u002Fbase_skills\u002Fdesktop-control\u002Fai_agent.py",{"path":66,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":67,"sourceHtmlUrl":68},"demo.py",6950,"https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Fdocker\u002Fbase_skills\u002Fdesktop-control\u002Fdemo.py",{"path":70,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":71,"sourceHtmlUrl":72},"QUICK_REFERENCE.md",5253,"https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Fdocker\u002Fbase_skills\u002Fdesktop-control\u002FQUICK_REFERENCE.md",[74,81,88,95,102,109],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M78127EY3XPHMS16Y8A8B6NR","cli-anything-zoom","Command-line interface for Zoom — manage meetings, participants, and recordings from the command line via the Zoom REST API.","https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Finjection\u002F205_cross_platform_zh\u002Ftask_205_33_calendar_scheduling\u002Fskills\u002Fcli-anything-zoom\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M78123F7PCSTEZ8CT3DBEGBT","netease-music-cli","CLI for NetEase Cloud Music — search songs\u002Falbums\u002Fplaylists, get lyrics, and manage your music library from the terminal.","https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Finjection\u002F205_cross_platform_zh\u002Ftask_205_26_music_crossid\u002Fskills\u002Fnetease-music-cli\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":18},"01M78120M9QEN0MQB9X0FCKSZX","google-calendar-gcalcli","Install and use gcalcli for live Google Calendar read access using the provided OAuth cache.","https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Finjection\u002F203_long_context_zh\u002Ftask_203_08_hk_jpop_calendar_ticketing\u002Fskills\u002Fgoogle-calendar-gcalcli\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":18},"01M7811TTCHD4JW4FG5HG1PVY9","Excel \u002F XLSX","Create, inspect, and edit Microsoft Excel workbooks and XLSX files with reliable formulas, dates, types, formatting, recalculation, and template preservation. Use when (1) the task is about Excel, `.xlsx`, `.xlsm`, `.xls`, `.csv`, or `.tsv`; (2) formulas, formatting, workbook structure, or compatibility matter; (3) the file must stay reliable after edits.","https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Finjection\u002F201_skill_usage_zh\u002Ftask_201_40_excel_dashboard_qa\u002Fskills\u002Fexcel-xlsx\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":18},"01M7811PGJQ4XDQ7XJ0TKNSEE6","duckdb-en","DuckDB CLI specialist for SQL analysis, data processing and file conversion. Use for SQL queries, CSV\u002FParquet\u002FJSON analysis, database queries, or data conversion. Triggers on \"duckdb\", \"sql\", \"query\", \"data analysis\", \"parquet\", \"convert data\".","https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Finjection\u002F201_skill_usage_zh\u002Ftask_201_40_excel_dashboard_qa\u002Fskills\u002Fduckdb-cli-ai-skills\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":18},"01M7811JSJW78171B25VJ285A0","automate-excel","Automates reading, writing, merging, transforming, and validating Excel (.xlsx\u002F.xls) files. Use when the user works with spreadsheets, .xlsx files, Excel data — for cleaning, joining, validating, deduplicating, aggregating, filtering, or auditing tabular data.","https:\u002F\u002Fgithub.com\u002FHKU-MMLab\u002FUniClawBench\u002Fblob\u002Fmain\u002Finjection\u002F201_skill_usage_zh\u002Ftask_201_40_excel_dashboard_qa\u002Fskills\u002Fautomate-excel\u002FSKILL.md",[],[]]