How hylmithecoder/handgesturemouse works
Hand Gesture Mouse is a real-time webcam application that turns hand poses into pointer, click, scroll, and desktop-navigation actions. The principal flow is camera frames through landmark tracking and gesture detection, then gesture control through a platform backend. Configuration tunes this flow; smoothing stabilizes pointer movement, and a separate tray widget reports gesture status. The excerpts show the main loop and controller, but not tracker internals or the Windows backend implementation, so those relationships are limited to documented or visible wiring.
Main entry points: main.py Runtime loop · __init__.py Backend selector · controller.py Gesture controller · hyprland.py Hyprland backend
Components 19
Application runtime
- Runtime loop
main.py - Configuration
handgesture/config.py
Gesture processing
- Hand tracker
handgesture/tracker.py - Gesture detector
handgesture/gestures.py - Pointer smoother
handgesture/smoothing.py
Desktop actions
- Gesture controller
handgesture/controller.py - Backend selector
handgesture/backends/__init__.py - Backend interface
handgesture/backends/base.py - Dry-run backend
handgesture/backends/base.py - Hyprland backend
handgesture/backends/hyprland.py - Pynput backend
handgesture/backends/pynput_base.py - Windows backend
handgesture/backends/windows.py - macOS backend
handgesture/backends/macos.py
Status interface
- Tray widget
handgesture/tray.py
Other components
- User
- Webcam
- Desktop environment
- ydotool service
- System tray host
Connections 22
- User → Webcam: makes gestures
README.md - Webcam → Runtime loop: provides frames
main.py - Runtime loop → Hand tracker: processes frames
main.py - Hand tracker → Runtime loop: returns landmarks
main.py - Runtime loop → Gesture detector: classifies landmarks
main.py - Gesture detector → Runtime loop: returns gesture
main.py - Runtime loop → Gesture controller: updates actions
main.py - Runtime loop → Backend selector: selects backend
main.py - Runtime loop → Configuration: configures runtime
main.py - Gesture controller → Pointer smoother: smooths pointer
handgesture/controller.py - Gesture controller → Backend interface: dispatches actions
handgesture/controller.py - Backend selector → Dry-run backend: selects dry run
handgesture/backends/__init__.py - Backend selector → Hyprland backend: selects on Hyprland
handgesture/backends/__init__.py - Backend selector → Windows backend: selects on Windows
handgesture/backends/__init__.py - Backend selector → macOS backend: selects on macOS
handgesture/backends/__init__.py - Hyprland backend → Desktop environment: sends desktop actions
handgesture/backends/hyprland.py - Hyprland backend → ydotool service: sends pointer events
handgesture/backends/hyprland.py - Windows backend → Pynput backend: uses shared controls
handgesture/backends/windows.py - macOS backend → Pynput backend: uses shared controls
handgesture/backends/macos.py - Pynput backend → Desktop environment: injects input
- Runtime loop → Tray widget: updates gesture status
main.py - Tray widget → System tray host: registers status icon
handgesture/tray.py