Skill: niveroviero/desk (version 1.0.0)

--- description: Optimized desktop automation with mouse, keyboard, and screen control --- # Desktop Control Skill **High-performance desktop automation for OpenClaw.** Optimized for minimal latency, efficient resource usage, and robust error handling. ## 🚀 Quick Start ```python from desktop_control import DesktopController # Context manager ensures cleanup with DesktopController() as dc: dc.move_mouse(500, 300) dc.click() dc.type_text("Hello World!") ``` ## 📦 Installation ```bash pip install -r requirements.txt ``` ## ✨ Features ### Mouse Control - **Instant movements** (0ms overhead) - **Smooth animations** with easing curves - **Relative positioning** from current location - **Click variations**: left, right, middle, double - **Drag & drop** with configurable duration - **Scroll**: vertical and horizontal ### Keyboard Control - **Type text** with WPM or interval control - **Hotkeys** (Ctrl+C, Alt+Tab, etc.) - **Key combinations** via context manager - **Individual key** press/hold/release ### Screen Operations - **Fast screenshots** to file or PIL Image - **Pixel color** reading - **Image finding** on screen (OpenCV) - **Region capture** for performance - **Wait for image** with timeout ### Window Management - **List all windows** - **Activate by title** (partial match) - **Get active window** ### Safety Features - **Corner failsafe** - move mouse to any corner to abort - **Bounds checking** - prevents off-screen coordinates - **Retry logic** - auto-retry flaky operations - **Approval mode** - ask before each action --- ## 🔧 API Reference ### DesktopController ```python DesktopController( failsafe: bool = True, # Abort on corner detection require_approval: bool = False, # Ask before actions log_level: int = logging.INFO # Verbosity ) ``` **Context Manager Support:** ```python with DesktopController() as dc: # Automatic cleanup on exit dc.type_text("Hello") ``` --- ### Mouse Operations #### `move_mouse(x, y, duration=0, smooth=True)` Move to absolute coordinates instantly or with animation. ```python dc.move_mouse(1000, 500) # Instant dc.move_mouse(1000, 500, duration=0.5) # Smooth 0.5s dc.move_mouse(1000, 500, smooth=False) # Linear movement ``` #### `move_relative(dx, dy, duration=0)` Move from current position. ```python dc.move_relative(100, -50) # Right 100, Up 50 ``` #### `click(x=None, y=None, button='left', clicks=1, interval=0.05)` Click with retry logic. ```python dc.click() # Current position dc.click(500, 300) # Specific position dc.click(button='right') # Right click dc.double_click(500, 300) # Double click (convenience) ``` #### `drag(x1, y1, x2, y2, duration=0.3, button='left')` Drag from point to point. ```python # Drag file from A to B dc.drag(200, 200, 800, 500, duration=0.5) ``` #### `scroll(amount, x=None, y=None, horizontal=False)` Scroll wheel. ```python dc.scroll(-5) # Down 5 clicks dc.scroll(10, 500, 300) # Scroll at position dc.scroll(3, horizontal=True) # Horizontal ``` --- ### Keyboard Operations #### `type_text(text, interval=None, wpm=None)` Type text with speed control. ```python dc.type_text("Instant!", interval=0) # No delay dc.type_text("Human-like", wpm=80) # 80 words per minute dc.type_text("Custom", interval=0.1) # 100ms between keys ``` #### `hotkey(*keys, interval=0.01)` Execute keyboard shortcuts. ```python dc.hotkey('ctrl', 'c') # Copy dc.hotkey('alt', 'tab') # Switch window dc.hotkey('ctrl', 'shift', 'esc') # Task manager ``` #### `press(key, presses=1, interval=0.05)` Press individual keys. ```python dc.press('enter') dc.press('space', presses=3) dc.press('f5') # Refresh ``` #### Key Hold Context Manager Hold keys during a block: ```python with dc.hold_keys('ctrl', 'shift'): dc.press('end') # Ctrl+Shift+End dc.click(500, 300) # Ctrl+Shift+Click ``` --- ### Screen Operations #### `screenshot(region=None, filename=None)` Capture screen with retry logic. ```python # Full screen to PIL Image img = dc.screenshot() # Save to file (returns None) dc.screenshot(filename="screen.png") # Region only (left, top, width, height) dc.screenshot(region=(100, 100, 800, 600), filename="region.png") ``` #### `screenshot_to_file(filename, region=None)` Convenience method that returns filename. ```python path = dc.screenshot_to_file(f"capture_{time.time()}.png") ``` #### `get_pixel(x, y)` Get RGB color at coordinates. ```python r, g, b = dc.get_pixel(500, 300) ``` #### `find_on_screen(image_path, confidence=0.9, grayscale=True)` Find image on screen. ```python # Returns (x, y, width, height) or None location = dc.find_on_screen("button.png", confidence=0.9) if location: x, y, w, h = location dc.click(x + w//2, y + h//2) # Click center ``` #### `find_all_on_screen(image_path, confidence=0.9)` Find all occurrences. ```python matches = dc.find_all_on_screen("icon.png") for x, y, w, h in matches: print(f"Found at ({x}, {y})") ``` #### `wait_for_image(image_path, timeout=10.0, interval=0.5)` Wait for image to appear. ```python location = dc.wait_for_image("loading_complete.png", timeout=30) if location: print("Ready!") ``` --- ### Window Operations #### `get_all_windows()` List all window titles. ```python windows = dc.get_all_windows() for title in windows: if "Chrome" in title: print(f"Found: {title}") ``` #### `activate_window(title, partial=True)` Bring window to front. ```python dc.activate_window("Chrome") # Partial match dc.activate_window("Untitled - Notepad", partial=False) # Exact ``` #### `get_active_window()` Get current window title. ```python current = dc.get_active_window() ``` #### `find_window(title_substring)` Find window by partial title. ```python title = dc.find_window("Document") if title: dc.activate_window(title) ``` --- ### Clipboard ```python # Copy to clipboard dc.copy_to_clipboard("Hello") # Get from clipboard text = dc.get_clipboard() ``` --- ### Utility ```python # Sleep (same as time.sleep) dc.sleep(0.5) # Wait for key press dc.wait_for_key('space', timeout=10.0) # Show alert dc.alert("Operation complete!") # Confirm dialog if dc.confirm("Proceed?"): print("User said yes") ``` --- ## 🎯 Performance Tips 1. **Use context managers** for automatic cleanup: ```python with DesktopController() as dc: # operations ``` 2. **Minimize screenshots** in loops: ```python # Bad - screenshot every iteration for _ in range(100): dc.screenshot() # Better - cache or use find_on_screen with interval ``` 3. **Use instant movements** when smoothness isn't needed: ```python dc.move_mouse(x, y, duration=0) # vs 0.5s ``` 4. **Batch keyboard operations** with hotkeys: ```python # One hotkey call dc.hotkey('ctrl', 'a') # Instead of multiple key presses ``` 5. **Use grayscale for image matching** (2x faster): ```python dc.find_on_screen("image.png", grayscale=True) ``` --- ## 🛡️ Safety ### Failsafe Mode ```python # Move mouse to any corner to abort all automation dc = DesktopController(failsafe=True) ``` ### Approval Mode ```python # Ask before each action dc = DesktopController(require_approval=True) dc.click(500, 300) # Prompts: "Allow left click at (500, 300)? [y/n]" ``` --- ## 🔌 AI Agent (Optional) For cognitive automation with task planning: ```python from ai_agent import create_agent with create_agent() as agent: result = agent.execute_task("Type Hello World in Notepad") print(f"Status: {result.status}") ``` See `ai_agent.py` for full capabilities. --- ## 📋 Quick Reference ```python from desktop_control import ( DesktopController, get_controller, move, click, typewrite, hotkey, screenshot ) # Initialize dc = DesktopController() # Mouse dc.move_mouse(x, y) dc.click(x, y) dc.drag(x1, y1, x2, y2) dc.scroll(amount) pos = dc.get_mouse_position() # Keyboard dc.type_text(text, wpm=80) dc.hotkey('ctrl', 'c') dc.press('enter') with dc.hold_keys('ctrl'): dc.click(x, y) # Screen img = dc.screenshot() dc.screenshot_to_file("out.png") color = dc.get_pixel(x, y) loc = dc.find_on_screen("image.png") # Window windows = dc.get_all_windows() dc.activate_window("Chrome") ``` --- **Built for OpenClaw** - Optimized for speed and reliability 🦞

path: AI_AGENT_GUIDE.md
content: # AI Desktop Agent - Cognitive Automation Guide

## 🤖 What Is This?

The **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.

Unlike basic automation that requires exact instructions, the AI Agent:
- **Understands natural language** ("Draw a cat in Paint")
- **Plans the steps** automatically
- **Executes autonomously** 
- **Adapts** based on what it sees

---

## 🎯 What Can It Do?

### ✅ Autonomous Drawing
```python
from skills.desktop_control.ai_agent import AIDesktopAgent

agent = AIDesktopAgent()

# Just describe what you want!
agent.execute_task("Draw a circle in Paint")
agent.execute_task("Draw a star in MS Paint")
agent.execute_task("Draw a house with a sun")
```

**What it does:**
1. Opens MS Paint
2. Selects pencil tool
3. Figures out how to draw the requested shape
4. Draws it autonomously
5. Takes a screenshot of the result

### ✅ Autonomous Text Entry
```python
# It figures out where to type
agent.execute_task("Type 'Hello World' in Notepad")
agent.execute_task("Write an email saying thank you")
```

**What it does:**
1. Opens Notepad (or finds active text editor)
2. Types the text naturally
3. Formats if needed

### ✅ Autonomous Application Control
```python
# It knows how to open apps
agent.execute_task("Open Calculator")
agent.execute_task("Launch Microsoft Paint")
agent.execute_task("Open File Explorer")
```

### ✅ Autonomous Game Playing (Advanced)
```python
# It will try to play the game!
agent.execute_task("Play Solitaire for me")
agent.execute_task("Play Minesweeper")
```

**What it does:**
1. Analyzes the game screen
2. Detects game state (cards, mines, etc.)
3. Decides best move
4. Executes the move
5. Repeats until win/lose

---

## 🏗️ How It Works

### Architecture

```
User Request ("Draw a cat")
    ↓
Natural Language Understanding
    ↓
Task Planning (Step-by-step plan)
    ↓
Step Execution Loop:
    - Observe Screen (Computer Vision)
    - Decide Action (AI Reasoning)
    - Execute Action (Desktop Control)
    - Verify Result
    ↓
Task Complete!
```

### Key Components

1. **Task Planner** - Breaks down high-level tasks into steps
2. **Vision System** - Understands what's on screen (screenshots, OCR, object detection)
3. **Reasoning Engine** - Decides what to do next
4. **Action Executor** - Performsthe actual mouse/keyboard actions
5. **Feedback Loop** - Verifies actions succeeded

---

## 📋 Supported Tasks (Current)

### Tier 1: Fully Automated ✅

| Task Pattern | Example | Status |
|-------------|---------|---------|
| Draw shapes in Paint | "Draw a circle" | ✅ Working |
| Basic text entry | "Type Hello" | ✅ Working |
| Launch applications | "Open Paint" | ✅ Working |

### Tier 2: Partially Automated 🔨

| Task Pattern | Example | Status |
|-------------|---------|---------|
| Form filling | "Fill out this form" | 🔨 In Progress |
| File operations | "Copy these files" | 🔨 In Progress |
| Web navigation | "Find on Google" | 🔨 Planned |

### Tier 3: Experimental 🧪

| Task Pattern | Example | Status |
|-------------|---------|---------|
| Game playing | "Play Solitaire" | 🧪 Experimental |
| Image editing | "Resize this photo" | 🧪 Planned |
| Code editing | "Fix this bug" | 🧪 Research |

---

## 🎨 Example: Drawing in Paint

### Simple Request
```python
agent = AIDesktopAgent()
result = agent.execute_task("Draw a circle in Paint")

# Check result
print(f"Status: {result['status']}")
print(f"Steps taken: {len(result['steps'])}")
```

### What Happens Behind the Scenes

**1. Planning Phase:**
```
Plan generated:
  Step 1: Launch MS Paint
  Step 2: Wait 2s for Paint to load
  Step 3: Activate Paint window
  Step 4: Select pencil tool (press 'P')
  Step 5: Draw circle at canvas center
  Step 6: Screenshot the result
```

**2. Execution Phase:**
```
[✓] Launched Paint via Win+R → mspaint
[✓] Waited 2.0s
[✓] Activated window "Paint"
[✓] Pressed 'P' to select pencil
[✓] Drew circle with 72 points
[✓] Screenshot saved: drawing_result.png
```

**3. Result:**
```python
{
    "task": "Draw a circle in Paint",
    "status": "completed",
    "success": True,
    "steps": [... 6 steps ...],
    "screenshots": [... 6 screenshots ...],
}
```

---

## 🎮 Example: Game Playing

```python
agent = AIDesktopAgent()

# Play a simple game
result = agent.execute_task("Play Solitaire for me")
```

### Game Playing Loop

```
1. Analyze screen → Detect cards, positions
2. Identify valid moves → Find legal plays
3. Evaluate moves → Which is best?
4. Execute move → Click and drag card
5. Repeat until game ends
```

### Game-Specific Intelligence

The agent can learn patterns for:
- **Solitaire**: Card stacking rules, suit matching
- **Minesweeper**: Probability calculations, safe clicks
- **2048**: Tile merging strategy
- **Chess** (if integrated with engine): Move evaluation

---

## 🧠 Enhancing the AI

### Adding Application Knowledge

```python
# In ai_agent.py, add to app_knowledge:

self.app_knowledge = {
    "photoshop": {
        "name": "Adobe Photoshop",
        "launch_command": "photoshop",
        "common_actions": {
            "new_layer": {"hotkey": ["ctrl", "shift", "n"]},
            "brush_tool": {"hotkey": ["b"]},
            "eraser": {"hotkey": ["e"]},
        }
    }
}
```

### Adding Custom Task Patterns

```python
# Add a custom planning method
def _plan_photo_edit(self, task: str) -> List[Dict]:
    """Plan for photo editing tasks."""
    return [
        {"type": "launch_app", "app": "photoshop"},
        {"type": "wait", "duration": 3.0},
        {"type": "open_file", "path": extracted_path},
        {"type": "apply_filter", "filter": extracted_filter},
        {"type": "save_file"},
    ]
```

---

## 🔥 Advanced: Vision + Reasoning

### Screen Analysis

The agent can analyze screenshots to:
- **Detect UI elements** (buttons, text fields, menus)
- **Read text** (OCR for labels, instructions)
- **Identify objects** (icons, images, game pieces)
- **Understand layout** (where things are)

```python
# Analyze what's on screen
analysis = agent._analyze_screen()

print(analysis)
# Output:
# {
#     "active_window": "Untitled - Paint",
#     "mouse_position": (640, 480),
#     "detected_elements": [...],
#     "text_found": [...],
# }
```

### Integration with OpenClaw LLM

```python
# Future: Use OpenClaw's LLM for reasoning
agent = AIDesktopAgent(llm_client=openclaw_llm)

# The agent can now:
# - Reason about complex tasks
# - Understand context better
# - Plan more sophisticated workflows
# - Learn from feedback
```

---

## 🛠️ Extending for Your Needs

### Add Support for New Apps

1. **Identify the app**
2. **Document common actions**
3. **Add to knowledge base**
4. **Create planning method**

Example: Adding Excel support

```python
# Step 1: Add to app_knowledge
"excel": {
    "name": "Microsoft Excel",
    "launch_command": "excel",
    "common_actions": {
        "new_sheet": {"hotkey": ["shift", "f11"]},
        "sum_formula": {"action": "type", "text": "=SUM()"},
    }
}

# Step 2: Create planner
def _plan_excel_task(self, task: str) -> List[Dict]:
    return [
        {"type": "launch_app", "app": "excel"},
        {"type": "wait", "duration": 2.0},
        # ... specific Excel steps
    ]

# Step 3: Hook into main planner
if "excel" in task_lower or "spreadsheet" in task_lower:
    return self._plan_excel_task(task)
```

---

## 🎯 Real-World Use Cases

### 1. Automated Form Filling
```python
agent.execute_task("Fill out the job application with my resume data")
```

### 2. Batch Image Processing
```python
agent.execute_task("Resize all images in this folder to 800x600")
```

### 3. Social Media Posting
```python
agent.execute_task("Post this image to Instagram with caption 'Beautiful sunset'")
```

### 4. Data Entry
```python
agent.execute_task("Copy data from this PDF to Excel spreadsheet")
```

### 5. Testing
```python
agent.execute_task("Test the login form with invalid credentials")
```

---

## ⚙️ Configuration

### Enable/Disable Failsafe
```python
# Safe mode (default)
agent = AIDesktopAgent(failsafe=True)

# Fast mode (no failsafe)
agent = AIDesktopAgent(failsafe=False)
```

### Set Max Steps
```python
# Prevent infinite loops
result = agent.execute_task("Play game", max_steps=100)
```

### Access Action History
```python
# Review what the agent did
print(agent.action_history)
```

---

## 🐛 Debugging

### View Step-by-Step Execution
```python
result = agent.execute_task("Draw a star in Paint")

for i, step in enumerate(result['steps'], 1):
    print(f"Step {i}: {step['step']['description']}")
    print(f"  Success: {step['success']}")
    if 'error' in step:
        print(f"  Error: {step['error']}")
```

### View Screenshots
```python
# Each step captures before/after screenshots
for screenshot_pair in result['screenshots']:
    before = screenshot_pair['before']
    after = screenshot_pair['after']
    
    # Display or save for analysis
    before.save(f"step_{screenshot_pair['step']}_before.png")
    after.save(f"step_{screenshot_pair['step']}_after.png")
```

---

## 🚀 Future Enhancements

Planned features:

- [ ] **Computer Vision**: OCR, object detection, UI element recognition
- [ ] **LLM Integration**: Natural language understanding with OpenClaw LLM
- [ ] **Learning**: Remember successful patterns, improve over time
- [ ] **Multi-App Workflows**: "Get data from Chrome and put in Excel"
- [ ] **Voice Control**: "Alexa, draw a cat in Paint"
- [ ] **Autonomous Debugging**: Fix errors automatically
- [ ] **Game AI**: Reinforcement learning for game playing
- [ ] **Web Automation**: Full browser control with understanding

---

## 📚 Full API

### Main Methods

```python
# Execute a task
result = agent.execute_task(task: str, max_steps: int = 50)

# Analyze screen
analysis = agent._analyze_screen()

# Manual mode: Execute individual steps
step = {"type": "launch_app", "app": "paint"}
result = agent._execute_step(step)
```

### Result Structure

```python
{
    "task": str,                    # Original task
    "status": str,                  # "completed", "failed", "error"
    "success": bool,                # Overall success
    "steps": List[Dict],            # All steps executed
    "screenshots": List[Dict],      # Before/after screenshots
    "failed_at_step": int,          # If failed, which step
    "error": str,                   # Error message if failed
}
```

---

**🦞 Built for OpenClaw - The future of desktop automation!**


path: QUICK_REFERENCE.md
content: # Desktop Control - Quick Reference Card

## 🚀 Instant Start

```python
from skills.desktop_control import DesktopController

dc = DesktopController()
```

## 🖱️ Mouse Control (Top 10)

```python
# 1. Move mouse
dc.move_mouse(500, 300, duration=0.5)

# 2. Click
dc.click(500, 300)  # Left click at position
dc.click()           # Click at current position

# 3. Right click
dc.right_click(500, 300)

# 4. Double click
dc.double_click(500, 300)

# 5. Drag & drop
dc.drag(100, 100, 500, 500, duration=1.0)

# 6. Scroll
dc.scroll(-5)  # Scroll down 5 clicks

# 7. Get position
x, y = dc.get_mouse_position()

# 8. Move relative
dc.move_relative(100, 50)  # Move 100px right, 50px down

# 9. Smooth movement
dc.move_mouse(1000, 500, duration=1.0, smooth=True)

# 10. Middle click
dc.middle_click()
```

## ⌨️ Keyboard Control (Top 10)

```python
# 1. Type text (instant)
dc.type_text("Hello World")

# 2. Type text (human-like, 60 WPM)
dc.type_text("Hello World", wpm=60)

# 3. Press key
dc.press('enter')
dc.press('tab')
dc.press('escape')

# 4. Hotkeys (shortcuts)
dc.hotkey('ctrl', 'c')      # Copy
dc.hotkey('ctrl', 'v')      # Paste  
dc.hotkey('ctrl', 's')      # Save
dc.hotkey('win', 'r')       # Run dialog
dc.hotkey('alt', 'tab')     # Switch window

# 5. Hold & release
dc.key_down('shift')
dc.type_text("hello")  # Types "HELLO"
dc.key_up('shift')

# 6. Arrow keys
dc.press('up')
dc.press('down')
dc.press('left')
dc.press('right')

# 7. Function keys
dc.press('f5')  # Refresh

# 8. Multiple presses
dc.press('backspace', presses=5)

# 9. Special keys
dc.press('home')
dc.press('end')
dc.press('pagedown')
dc.press('delete')

# 10. Fast combo
dc.hotkey('ctrl', 'alt', 'delete')
```

## 📸 Screen Operations (Top 5)

```python
# 1. Screenshot (full screen)
img = dc.screenshot()
dc.screenshot(filename="screen.png")

# 2. Screenshot (region)
img = dc.screenshot(region=(100, 100, 800, 600))

# 3. Get pixel color
r, g, b = dc.get_pixel_color(500, 300)

# 4. Find image on screen
location = dc.find_on_screen("button.png")

# 5. Get screen size
width, height = dc.get_screen_size()
```

## 🪟 Window Management (Top 5)

```python
# 1. Get all windows
windows = dc.get_all_windows()

# 2. Activate window
dc.activate_window("Chrome")

# 3. Get active window
active = dc.get_active_window()

# 4. List windows
for title in dc.get_all_windows():
    print(title)

# 5. Switch to app
dc.activate_window("Visual Studio Code")
```

## 📋 Clipboard (Top 2)

```python
# 1. Copy to clipboard
dc.copy_to_clipboard("Hello!")

# 2. Get from clipboard
text = dc.get_from_clipboard()
```

## 🔥 Real-World Examples

### Example 1: Auto-fill Form
```python
dc.click(300, 200)  # Name field
dc.type_text("John Doe", wpm=80)
dc.press('tab')
dc.type_text("[REDACTED_SECRET]", wpm=80)
dc.press('tab')
dc.type_text("Password123", wpm=60)
dc.press('enter')
```

### Example 2: Copy-Paste Automation
```python
# Select all
dc.hotkey('ctrl', 'a')
# Copy
dc.hotkey('ctrl', 'c')
# Wait
dc.pause(0.5)
# Switch window
dc.hotkey('alt', 'tab')
# Paste
dc.hotkey('ctrl', 'v')
```

### Example 3: File Operations
```python
# Select multiple files
dc.key_down('ctrl')
dc.click(100, 200)
dc.click(100, 250)
dc.click(100, 300)
dc.key_up('ctrl')
# Copy
dc.hotkey('ctrl', 'c')
```

### Example 4: Screenshot Workflow
```python
# Take screenshot
dc.screenshot(filename=f"capture_{time.time()}.png")
# Open in Paint
dc.hotkey('win', 'r')
dc.pause(0.5)
dc.type_text('mspaint')
dc.press('enter')
```

### Example 5: Search & Replace
```python
# Open Find & Replace
dc.hotkey('ctrl', 'h')
dc.pause(0.3)
# Type find text
dc.type_text("old_text")
dc.press('tab')
# Type replace text
dc.type_text("new_text")
# Replace all
dc.hotkey('alt', 'a')
```

## ⚙️ Configuration

```python
# With failsafe (move to corner to abort)
dc = DesktopController(failsafe=True)

# With approval mode (ask before each action)
dc = DesktopController(require_approval=True)

# Maximum speed (no safety checks)
dc = DesktopController(failsafe=False)
```

## 🛡️ Safety

```python
# Check if safe to continue
if dc.is_safe():
    dc.click(500, 500)

# Pause execution
dc.pause(2.0)  # Wait 2 seconds

# Emergency abort: Move mouse to any screen corner
```

## 🎯 Pro Tips

1. **Instant typing**: `interval=0` or `wpm=None`
2. **Human typing**: `wpm=60` (60 words/min)
3. **Smooth mouse**: `duration=0.5, smooth=True`
4. **Instant mouse**: `duration=0`
5. **Wait for UI**: `dc.pause(0.5)` between actions
6. **Failsafe**: Always enable for safety
7. **Test first**: Use `demo.py` to test features
8. **Coordinates**: Use `get_mouse_position()` to find them
9. **Screenshots**: Capture before/after for verification
10. **Hotkeys > Menus**: Faster and more reliable

## 📦 Dependencies

```bash
pip install pyautogui pillow opencv-python pygetwindow pyperclip
```

## 🚨 Common Issues

**Mouse not moving correctly?**
- Check DPI scaling in Windows settings
- Verify coordinates with `get_mouse_position()`

**Keyboard not working?**
- Ensure target app has focus
- Some apps block automation (games, secure apps)

**Failsafe triggering?**
- Keep mouse away from screen corners
- Disable if needed: `failsafe=False`

---

**Built for OpenClaw** 🦞 - Desktop automation made easy!


path: requirements.txt
content: pyautogui>=0.9.54
Pillow>=10.0.0
opencv-python>=4.8.0
pygetwindow>=0.0.9
pyperclip>=1.8.2
pyscreeze>=0.1.29


path: _meta.json
content: ownerId: kn7ag28ra4hhta8bx2k2j1kpv180kqbk
slug: desktop-control
version: 1.0.0
publishedAt: 1770255200863

path: __init__.py
content: """
Desktop Control Skill for OpenClaw
Optimized desktop automation with mouse, keyboard, and screen control

Usage:
    from desktop_control import DesktopController

    with DesktopController() as dc:
        dc.move_mouse(500, 300)
        dc.click()
        dc.type_text("Hello World!")
"""

from .desktop_control import (
    DesktopController,
    get_controller,
    reset_controller,
    move,
    click,
    typewrite,
    hotkey,
    screenshot,
    retry_on_error,
)

__version__ = "1.0.0"
__all__ = [
    "DesktopController",
    "get_controller",
    "reset_controller",
    "move",
    "click",
    "typewrite",
    "hotkey",
    "screenshot",
    "retry_on_error",
]


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)