# utkarsh713/virtual-mouse architecture

> Architecture diagram of the GitHub repository utkarsh713/virtual-mouse, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/utkarsh713/virtual-mouse
- Repository: https://github.com/utkarsh713/virtual-mouse

## Overview

AI Virtual Desktop Pro is a webcam-driven desktop controller. Its runtime loop captures and processes camera frames, obtains hand landmarks, maps finger positions and pinches to desktop actions, and displays the annotated view. The sampled source directly supports cursor movement, clicks, dragging, brightness changes, screenshots, and the live window; the README additionally documents scrolling, media and swipe actions, quick launches, and keyboard controls. The repository has one monolithic runtime file, so these components share its path. Documented-only capabilities are identified through README evidence.

Main entry points: [`virtual_mouse.py`](https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py) (Gesture Recognition), [`README.md`](https://github.com/utkarsh713/virtual-mouse/blob/main/README.md) (Other Gesture Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Hand Vision"]
  node_capture["Frame Capture<br/>[virtual_mouse.py]"]
  node_landmarks["Hand Landmarks<br/>[virtual_mouse.py]"]
  node_preview["Live Preview<br/>[virtual_mouse.py]"]
end

subgraph group_controls["Gesture Controls"]
  node_gesture["Gesture Recognition<br/>[virtual_mouse.py]"]
  node_keyboard["Keyboard Controls<br/>[README.md]"]
end

subgraph group_desktop["Desktop Output"]
  node_mouse["Mouse Actions<br/>[virtual_mouse.py]"]
  node_brightness["Brightness Control<br/>[virtual_mouse.py]"]
  node_screenshot["Screenshot Capture<br/>[virtual_mouse.py]"]
  node_other_actions["Other Gesture Actions<br/>[README.md]"]
end

node_camera(("Webcam"))
node_desktop_os["Desktop System"]
node_brightness_service["Brightness Service"]

node_camera -->|"provides frames"| node_capture
node_capture -->|"processes frames"| node_landmarks
node_landmarks -->|"supplies landmarks"| node_gesture
node_gesture -->|"dispatches actions"| node_mouse
node_gesture -->|"sets level"| node_brightness
node_gesture -->|"triggers capture"| node_screenshot
node_mouse -->|"controls pointer"| node_desktop_os
node_screenshot -->|"captures screen"| node_desktop_os
node_brightness -->|"sets brightness"| node_brightness_service
node_capture -->|"displays frame"| node_preview
node_gesture -.->|"maps gestures"| node_other_actions
node_keyboard -.->|"controls modes"| node_other_actions

click node_capture "https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py"
click node_landmarks "https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py"
click node_gesture "https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py"
click node_mouse "https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py"
click node_brightness "https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py"
click node_screenshot "https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py"
click node_other_actions "https://github.com/utkarsh713/virtual-mouse/blob/main/README.md"
click node_keyboard "https://github.com/utkarsh713/virtual-mouse/blob/main/README.md"
click node_preview "https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_capture,node_landmarks,node_preview toneBlue
class node_gesture,node_keyboard toneAmber
class node_mouse,node_brightness,node_screenshot,node_other_actions toneMint
class node_camera,node_desktop_os,node_brightness_service toneIndigo
```

## Components

### Hand Vision

- [Frame Capture](https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py): `virtual_mouse.py`
- [Hand Landmarks](https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py): `virtual_mouse.py`
- [Live Preview](https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py): `virtual_mouse.py`

### Gesture Controls

- [Gesture Recognition](https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py): `virtual_mouse.py`
- [Keyboard Controls](https://github.com/utkarsh713/virtual-mouse/blob/main/README.md): `README.md`

### Desktop Output

- [Mouse Actions](https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py): `virtual_mouse.py`
- [Brightness Control](https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py): `virtual_mouse.py`
- [Screenshot Capture](https://github.com/utkarsh713/virtual-mouse/blob/main/virtual_mouse.py): `virtual_mouse.py`
- [Other Gesture Actions](https://github.com/utkarsh713/virtual-mouse/blob/main/README.md): `README.md`

### Other components

- **Webcam**
- **Desktop System**
- **Brightness Service**

## Connections

- Webcam → Frame Capture: provides frames (evidence: `virtual_mouse.py`)
- Frame Capture → Hand Landmarks: processes frames (evidence: `virtual_mouse.py`)
- Hand Landmarks → Gesture Recognition: supplies landmarks (evidence: `virtual_mouse.py`)
- Gesture Recognition → Mouse Actions: dispatches actions (evidence: `virtual_mouse.py`)
- Gesture Recognition → Brightness Control: sets level (evidence: `virtual_mouse.py`)
- Gesture Recognition → Screenshot Capture: triggers capture (evidence: `virtual_mouse.py`)
- Mouse Actions → Desktop System: controls pointer (evidence: `virtual_mouse.py`)
- Screenshot Capture → Desktop System: captures screen (evidence: `virtual_mouse.py`)
- Brightness Control → Brightness Service: sets brightness (evidence: `virtual_mouse.py`)
- Frame Capture → Live Preview: displays frame (evidence: `virtual_mouse.py`)
- Gesture Recognition → Other Gesture Actions: maps gestures (evidence: `README.md`)
- Keyboard Controls → Other Gesture Actions: controls modes (evidence: `README.md`)
