Skip to main content

AI Virtual Mouse Controller

Controle seu computador com gestos da mão.

CI PyPI Python License

Webcam → 21 landmarks → cursor do sistema. Sem hardware extra. Sem GPU.



🖐️ mover

🤏 clique

🤞 clique direito

✌️ duplo clique

✊ pausa

Site oficial →  ·  Guia de uso →  ·  Changelog →


O que é

Sistema gestual de controle de cursor com qualidade comparável a periféricos físicos. O MediaPipe identifica 21 pontos da mão em tempo real, uma state machine traduz gestos em eventos do sistema operacional (move, click, drag, scroll), e um holograma 3D opcional renderiza a mão virtual sobre o desktop.

100% local. Sem nuvem, sem telemetria, sem persistir nada da webcam.

Stack: Python 3.11+ · OpenCV · MediaPipe · PyAutoGUI · NumPy · ModernGL/PySide6 (opcional)


Instalar

Requer Python 3.11 ou 3.12 + webcam.

pip install ai-virtual-mouse-controller
avmc

Posicione a mão a ~50cm da câmera. Atalhos em runtime:

Tecla Ação
H liga/desliga o holograma 3D
S abre/fecha o painel de configurações
T alterna janela sempre-no-topo
ESC sai
Instalação via clone do repositório
git clone https://github.com/ognistie/ai-virtual-mouse-controller.git
cd ai-virtual-mouse-controller
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python main.py

Para desenvolvimento: make dev instala dependências + pre-commit hooks.


Atualizar

pip install --upgrade ai-virtual-mouse-controller

Conferir a versão instalada:

pip show ai-virtual-mouse-controller

Se quiser pular o cache do pip e baixar do PyPI direto:

pip install --no-cache-dir --upgrade ai-virtual-mouse-controller

Para quem instalou via clone do repo:

cd ai-virtual-mouse-controller
git pull origin main
pip install -r requirements.txt

Histórico de mudanças em CHANGELOG.md.


Gestos

Gesto Símbolo Ação
Mão aberta — 4 dedos pra cima 🖐️ Move o cursor
Pinça polegar + indicador 🤏 Clique simples
Pinça polegar + indicador (1,5s+) 🤏 Iniciar arrasto (drag)
Pinça polegar + médio 🤞 Clique direito
Dois dedos (paz) ✌️ Duplo clique
Punho fechado ✊ Cursor congelado
Mão fora do frame — Pausa automática

Os cliques (esquerdo e direito) disparam no press — assim que os dedos se encostam — replicando o feedback de um botão físico.


Configuração

Toda a calibração vive em config.py — constantes nomeadas com docstrings explicando o quê, o porquê e o intervalo de ajuste. Principais grupos:

Seção O que controla
CAMERA índice da câmera, resolução, FPS alvo
CURSOR_ANCHOR qual ponto da mão o cursor segue (-2 = âncora robusta, default)
PINCH thresholds de detecção de clique (com escala adaptativa por tamanho da mão)
DPI / SMOOTHING sensibilidade do cursor + filtro OneEuro
SCREEN_MARGIN_* margens assimétricas (top/bottom < lateral) pra alcançar cantos
CURSOR_FOLLOWTHROUGH_* cinematic prediction quando a mão sai do FOV
HOLOGRAM backend (GL/QPainter), cor, opacidade, FPS

Ajustes em tempo de execução também ficam disponíveis no painel (tecla S) — perfis prontos: smooth, precise, responsive, stable.


Compatibilidade

OS Setup adicional
🪟 Windows 10/11 Nada. Funciona out-of-the-box após pip install.
🍎 macOS Após primeiro run, liberar System Settings → Privacy & Security → Accessibility (cursor) e Camera (webcam). Em Apple Silicon, se PyAutoGUI reclamar: pip install pyobjc-core pyobjc.
🐧 Linux (X11) sudo apt install scrot python3-tk python3-dev (Ubuntu/Debian). PyAutoGUI precisa desses pra capturar a tela.
🐧 Linux (Wayland) Suporte limitado de PyAutoGUI. Recomendado mudar pra sessão X11.

Mediapipe pin: o projeto usa mediapipe < 0.10.30. Versões 0.10.30+ removeram o módulo mp.solutions.hands que sustenta o pipeline. O pyproject.toml já fixa o limite — não há nada manual pra fazer.


Como funciona

webcam → MediaPipe Hands (21 landmarks)
          ↓
     RobustHandAnchor  ← combina anatomia + estabilidade + edge extrapolation
          ↓
     GestureDetector   ← state machine: shape → event (CLICK, MOVE, DRAG…)
          ↓
     OneEuroSmoother   ← filtro adaptativo de cursor
          ↓
     CursorController  ← PyAutoGUI move o cursor real

Componentes auxiliares: HologramOverlay (renderização 3D opcional via ModernGL), RuntimeSettings (perfis e sliders), PerfTelemetry (timing p50/p99 por estágio).

Estrutura de pastas:

core/        # camera, hand_tracker, gesture_detector, hand_anchor, smoothing
services/    # orquestração do loop principal
config.py    # constantes de calibração documentadas
main.py      # entry point
tests/       # cobertura dos módulos puros (sem cv2/mediapipe)
docs/        # site estático + assets

Contribuir

Issues, PRs e feedback técnico são bem-vindos. Comece em CONTRIBUTING.md. Bugs em issues.

Workflow local rápido:

make dev        # instala deps + hooks
make check      # ruff + mypy + pytest
make test-fast  # só testes rápidos (sem GPU/integration/slow)
make test-gpu   # só testes que precisam de display/GPU real
make test-cov   # com coverage HTML

Testes marcados com gpu (overlay PySide6/ModernGL) ficam fora do pytest default — eles requerem display real e podem crashar em ambientes headless. Rode-os explicitamente com make test-gpu quando estiver mexendo no holograma.


Metadata

Release files for ai-virtual-mouse-controller 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-virtual-mouse-controller 1.1.2
File Size Uploaded
ai_virtual_mouse_controller-1.1.2.tar.gz 128.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-virtual-mouse-controller 1.1.2
File Interpreter ABI Platform
ai_virtual_mouse_controller-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 247.7 kB

Release files / ai_virtual_mouse_controller-1.1.2.tar.gz

Download URL ai_virtual_mouse_controller-1.1.2.tar.gz
Size 128.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c6ad37ae1f3d0aba2cf39fe167a832761b0f8ecf3c3a4eda8df0fa6998652aec
BLAKE2b-256 checksum
How to use checksums
a68b7bbcb38d68befcb11872fc5c7266efc0e4f51aebf5dcaab8686327431844
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.

Transparency log

Release files / ai_virtual_mouse_controller-1.1.2-py3-none-any.whl

Download URL ai_virtual_mouse_controller-1.1.2-py3-none-any.whl
Size 119.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d479b0214f991f8b97adf49049f7c5b1e816ad9c7db26ee122218b4a86a9c923
BLAKE2b-256 checksum
How to use checksums
fdb4c01ab7f1023c02808b969011e6c6622b3844474b9753190077bae83eac6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.

Transparency log

Release history Release notifications | RSS feed

1.3.0

2 release files

1.2.0

2 release files

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page