Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

AirControl Mouse Pro - Studio Edition v2.0.0

Automated Tests Python 3.11 | 3.12 | 3.13 Windows 10/11 PySide6 Studio 21 Gestures 100% Offline

AirControl Mouse Pro (Studio Edition v2.0.0) transforms any standard Windows webcam into a low-latency, conflict-free 21-gesture desktop command studio — uniting smooth cursor tracking, zero-jump precision aim, drag-and-drop, clipboard shortcuts, media transport, and hardware-level safety interlocks in a bespoke PySide6 dark interface.

Studio Preview • Highlights • Quick Start • 21 Gesture Controls • Safety Architecture • Repository Layout • Testing


Studio Interface Preview

Master Studio Home Dashboard

Home Dashboard — Corner-bracketed 21-keypoint OpenCV HUD, glowing KPI cards, 240° Live FPS & Confidence radial gauges, and real-time 16:9 Desktop Cursor Radar.

21 Vector Gesture Studio Cards
21 Vector-Illustrated Gesture Cards — Color-coded postures, action remapping & live cyan highlight
Calibration & Hardware Studio
Calibration Studio — EMA smoothing, palm-normalized pinch, Precision speed & SQLite persistence
Session Telemetry & Area-Gradient Charts

Telemetry & Session Analytics — Explicitly separates Detected Postures from Executed OS Actions with custom QPainter area-gradient FPS/latency curves and CSV export.


Engineering Highlights

Pillar What Makes AirControl Mouse Pro Different
21 Orthogonal Gestures Every hand posture is normalized by anatomical palm scale (max(d(WRIST, MIDDLE_MCP), d(INDEX_MCP, PINKY_MCP))) and partitioned into mutually exclusive geometric states with hysteresis — eliminating accidental clicks during cursor motion.
Zero-Jump Precision Mode Forming an upright L-shape (#12) anchors the current screen coordinate and scales subsequent hand deltas (0.30x default) for pixel-level targeting with zero cursor teleportation on entry or exit.
Master Studio PySide6 UI Custom hardware-accelerated QPainter widgets: breathing status orb, glowing top-bar KPI tiles, dual radial arc gauges, live 16:9 screen radar, and procedural vector hand + mouse illustrations on all 21 cards.
Multi-Layer Safety Gate Finite state machine (STOPPED / ACTIVE / PAUSED / EMERGENCY_STOP), Safe Simulation Mode, automatic mouse-button release on hand loss/shutdown, and always-active global Win32 hotkeys (F12, F9, Ctrl+Shift+R).
Honest SQLite Telemetry Persists user calibration, custom action remaps, session uptimes, and per-gesture Detected vs. Executed counts locally in data/aircontrol.db without cloud calls or unmeasured accuracy claims.
Dedicated QThread Pipeline Camera capture, MediaPipe 21-landmark inference, and gesture dispatch run on a clean worker QThread communicating with the Qt GUI strictly via thread-safe signals.

Quick Start (Windows PowerShell)

Prerequisites

  • OS: Windows 10 or Windows 11 (64-bit) with a built-in or USB webcam
  • Python: 64-bit Python 3.11, 3.12, or 3.13

Option A — Automated PowerShell Setup & Launch (Recommended)

Open PowerShell and run:

git clone https://github.com/abdulsalam025/AirControlMousePro.git
cd AirControlMousePro

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
.\scripts\setup.ps1
.\scripts\launch.ps1

What setup.ps1 + launch.ps1 do automatically:

  1. Detect a compatible 64-bit Python 3.11–3.13 interpreter and create .venv.
  2. Install verified Windows wheels (mediapipe==1.2.0, opencv-contrib-python, PySide6==6.11.0, PyAutoGUI==0.9.54, numpy<2.5.0, Pillow, pytest).
  3. Cache the official MediaPipe hand_landmarker.task bundle locally in assets/models/ for 100% offline operation.
  4. Run bytecode verification + all 13 automated pytest tests, then launch AirControl Mouse Pro.

Option B — Manual Virtual Environment Launch

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python main.py

First-Time Tip: Enable Safe Preview Mode in the bottom-left sidebar dock when testing lighting or camera placement. Every landmark, bounding box, gauge, and 21-card highlight runs live while OS cursor/key injection stays safely locked.


Complete 21-Gesture Control Matrix

Tier 1 — Core Mouse Controls (Green Cards #1–#6)

# Control Orthogonal Hand Posture Timing / Hysteresis OS Action
1 Move Cursor Upright index finger (middle/ring/pinky curled, thumb neutral) Continuous (EMA + dead-zone) Smooth OS cursor movement
2 Left Click Thumb + Index fingertip pinch tap & release Hold < 0.35s Single Left Click on release
3 Drag & Drop Thumb + Index pinch held + hand movement Hold >= 0.35s Press & hold Left Button, drag, release on unpinch
4 Right Click Thumb + Middle fingertip pinch (index upright) 70 ms confirm / 450 ms cooldown Context-menu Right Click
5 Double Click Index + Pinky upright (rock / horns sign) 180 ms confirm / 650 ms cooldown Double Left Click
6 Vertical Scroll Index + Middle upright V-sign (d(8,12)/palm >= 0.23), move up/down 70 ms confirm Smooth vertical scroll up / down

Tier 2 — System, Safety & Precision Controls (Blue/Red Cards #7–#12)

# Control Orthogonal Hand Posture Timing / Gate System Effect
7 Pause Tracking Closed fist (all 4 fingers curled, neutral thumb) ~0.28s hold Switches ACTIVE → PAUSED & releases held buttons
8 Resume Tracking Vertical Thumbs-Up while PAUSED ~0.20s hold + 0.85s guard Resumes PAUSED → ACTIVE (never overrides Emergency Stop)
9 Screenshot 4 upright fingers + thumb tucked ~0.50s hold Saves timestamped PNG to data/screenshots/
10 Switch Window 3 upright fingers (Index, Middle, Ring) + thumb out ~0.26s hold (single-fire) Triggers Alt + Tab window switcher
11 Emergency Stop All 5 fingers spread wide (splay > 0.88) or F12 ~0.60s hold / instant key Latches EMERGENCY_STOP & releases all OS input
12 Precision Mode Upright index + thumb extended sideways ("L" shape) ~0.35s hold Zero-jump fine-aim slow cursor (0.30x configurable)

Tier 3 — Clipboard, Undo/Redo & Media Controls (Purple Cards #13–#21)

# Control Orthogonal Hand Posture Dispatch Mode Shortcut / Media Key
13 Copy Thumb + Ring fingertip pinch Single-fire latched Ctrl + C
14 Paste Thumb + Pinky fingertip pinch Single-fire latched Ctrl + V
15 Undo 3 upright fingers (Index, Middle, Ring) + thumb tucked Single-fire latched Ctrl + Z
16 Redo 4 upright fingers close together (splay <= 0.88) + thumb out Single-fire latched Ctrl + Y
17 Play / Pause Media Upright Index + Middle with fingertips pressed together (< 0.23) Single-fire latched Media playpause
18 Volume Up Vertical Thumbs-Up while ACTIVE Repeats every 260 ms Media volumeup
19 Volume Down Vertical Thumbs-Down while ACTIVE Repeats every 260 ms Media volumedown
20 Previous Track Horizontal index point Left (other fingers curled) Single-fire latched Media prevtrack
21 Next Track Horizontal index point Right (other fingers curled) Single-fire latched Media nexttrack

Always-Active Global Windows Hotkeys

Shortcut Scope Action
F12 Global (Win32 + App) Immediate Emergency Stop — halts worker & releases any held mouse button
F9 Global (Win32 + App) Keyboard-Only Pause / Resume toggle (ACTIVE ↔ PAUSED)
Ctrl + Shift + R Global (Win32 + App) Keyboard-Only Emergency Reset & resume tracking

Safety & State Isolation

                  +-------------------+
                  |      STOPPED      |
                  +---------+---------+
                            | Start Tracking
                            v
                  +-------------------+     Closed Fist (~0.3s) / F9     +-------------------+
                  |      ACTIVE       | -------------------------------> |      PAUSED       |
                  |  (Live / Preview) | <------------------------------- | (Cursor Locked)   |
                  +---------+---------+     Thumbs-Up (~0.2s) / F9       +---------+---------+
                            |                                                      |
                            | 5-Finger Spread (~0.6s) or Global F12                | Global F12
                            +------------------------+-----------------------------+
                                                     v
                                       +---------------------------+
                                       |      EMERGENCY_STOP       |
                                       |  (Latched: Thumbs-Up OFF) |
                                       +-------------+-------------+
                                                     | Explicit Ctrl+Shift+R or GUI Confirmation
                                                     v
                                           STOPPED / ACTIVE
  • Guaranteed Button Release: Losing hand landmarks, pausing, triggering Emergency Stop, switching to Safe Preview, or closing the window immediately invokes MouseController.release_all() so the left mouse button can never remain stuck down.
  • Emergency Latch Integrity: Ordinary gestures (such as Thumbs-Up) are strictly blocked from clearing EMERGENCY_STOP; recovery requires explicit Ctrl+Shift+R or user confirmation in the GUI dialog.

Project Architecture

AirControlMousePro/
|-- main.py                          # High-DPI application entry point & rotating log setup
|-- requirements.txt                 # Verified Python 3.11-3.13 Windows dependencies
|-- app/
|   |-- config.py                    # Enums, 21-card metadata & validated AppSettings
|   |-- hand_tracker.py              # MediaPipe 21-landmark engine & sci-fi OpenCV HUD renderer
|   |-- gesture_recognizer.py        # Palm-normalized 21-posture classifier with hysteresis
|   |-- gesture_manager.py           # Temporal confirmation, cooldown, repeat & Precision dispatch
|   |-- mouse_controller.py          # ROI mapping, EMA filter, dead-zone, Precision & PyAutoGUI
|   |-- safety_manager.py            # Thread-safe state machine & Win32 global hotkey poller
|   |-- settings_manager.py          # SQLite configuration persistence (data/aircontrol.db)
|   |-- statistics_manager.py        # SQLite session/event telemetry & CSV exporter
|   |-- camera_worker.py             # QThread capture/inference loop with disconnect recovery
|   |-- theme.py                     # Multi-stop dark studio QSS & category palettes
|   |-- main_window.py               # Sidebar navigation, LiveStatusOrb & shortcut coordinator
|   `-- widgets/
|       |-- studio_widgets.py        # Custom QPainter gauges, radar, orb & 21 vector hand cards
|       |-- dashboard_page.py        # Hero header, Glow KPIs, HUD viewport & command dock
|       |-- gesture_page.py          # 21-card studio grid, action remapper & live event log
|       |-- settings_page.py         # Calibration sliders, camera scanner & safety mode controls
|       `-- statistics_page.py       # Area-gradient FPS/latency & Detected-vs-Executed charts
|-- scripts/
|   |-- setup.ps1                    # Automated Python 3.11-3.13 & .venv bootstrapper
|   |-- launch.ps1                   # Dependency installer, model cacher, pytest runner & launcher
|   `-- generate_assets.py           # Generates studio UI screenshots into assets/screenshots/
|-- assets/
|   |-- banner.svg                   # Vector repository hero banner
|   `-- screenshots/                 # Auto-rendered Studio Edition UI previews
`-- tests/
    |-- test_coordinate_mapping.py   # Bounds, tremor dead-zone & zero-jump Precision scaling
    |-- test_gesture_logic.py        # All 21 orthogonal postures, drag/tap, guard & latching
    `-- test_safety_manager.py       # Emergency latch, button release, SQLite & Studio UI render

Automated Testing

All gesture math, coordinate mapping, safety interlocks, SQLite persistence, and PySide6 Studio UI pages are verified with mocked mouse/camera backends (never moving your real cursor during tests):

.\.venv\Scripts\python.exe -m pytest -v

License

Released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages