# mouse-control **Repository Path**: guan4102/mouse-control ## Basic Information - **Project Name**: mouse-control - **Description**: 一个可以操控鼠标的skill - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-24 - **Last Updated**: 2026-07-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: AI ## README # Mouse Control Skill for Claude Code Control mouse, keyboard, and take screenshots on Windows via PowerShell + Win32 API. **Works on Windows 7+ with PowerShell 2.0+. No admin rights needed.** ## Install Run as administrator (or double-click): ```batch install.bat ``` This copies `mouse.cmd` to `%USERPROFILE%\bin\` (adds to PATH if needed) and the skill files to `%USERPROFILE%\.claude\skills\mouse-control\`. Or manually: ```batch mkdir "%USERPROFILE%\.claude\skills\mouse-control" 2>nul copy mouse.ps1 "%USERPROFILE%\.claude\skills\mouse-control\" copy SKILL.md "%USERPROFILE%\.claude\skills\mouse-control\" copy mouse.cmd "%USERPROFILE%\bin\" ``` ## Quick Start After install, Claude Code can use: ``` mouse pos # cursor position mouse shot # screenshot, returns path mouse move 500 300 # move cursor smoothly mouse click 500 300 # left click at coordinates mouse click right # right click at current position mouse dclick 500 300 # double click mouse drag 100 100 500 400 # drag from A to B mouse scroll -120 # scroll down 1 notch mouse type "hello{ENTER}" # send keystrokes mouse wins chrome # find windows matching "chrome" mouse focus notepad # bring window to foreground mouse chain "move 300 200; click; type hello" # multi-step ``` ## Full Action Reference | Action | Args | Output | Description | |--------|------|--------|-------------| | `pos` | - | `X,Y WxH` | Cursor position + screen size | | `screen` | - | `WxH` | Screen dimensions | | `shot` | `[path]` | file path | Save screenshot to PNG | | `move` | `x y [steps]` | `ok` | Smooth cursor movement | | `click` | `[l/r/m] [x] [y]` | `ok` | Mouse click | | `dclick` | `[x] [y]` | `ok` | Left double-click | | `right` | `[x] [y]` | `ok` | Right click (context menu) | | `drag` | `x1 y1 x2 y2` | `ok` | Click and drag | | `scroll` | `amount [x] [y]` | `ok` | +120=up, -120=down | | `type` | `"text"` | `ok` | SendKeys input | | `wins` | `[filter]` | window list | Enumerate windows | | `focus` | `title` | `focus: ...` | Bring window to front | | `chain` | `"cmd;cmd;..."` | per-cmd output | Execute multiple actions | ## Chain Examples ```bash # Click a button then type text mouse chain "move 300 400; click; type hello world{ENTER}" # Take screenshot, then click at a known location mouse chain "shot; move 200 150; click; shot" ``` ## Special Keys `{ENTER}` `{TAB}` `{ESC}` `{BS}` `{DEL}` `{HOME}` `{END}` `{PGUP}` `{PGDN}` `^c` (Ctrl+C) `^v` (Ctrl+V) `^a` (Ctrl+A) `^z` (Ctrl+Z) `{F1}` - `{F12}` `%{F4}` (Alt+F4) ## How It Works Uses PowerShell to call Win32 API directly: - `SetCursorPos` + `mouse_event` for mouse control - `GetCursorPos` for position tracking - `System.Windows.Forms.SendKeys` for keyboard input - `System.Drawing.Graphics.CopyFromScreen` for screenshots - `EnumWindows` + `SetForegroundWindow` for window management No external dependencies. No admin rights required. ## License MIT