Skip to content

Control your mouse without touching anything, this is for you if you often have a dirty hands.

Notifications You must be signed in to change notification settings

ShafwanAbd/handsfree-mouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–οΈ Touchless Hand Tracking Mouse Control

This project uses OpenCV, MediaPipe, and PyAutoGUI to let you control your computer mouse without touching it β€” using only your hand gestures detected from your webcam!


✨ Features

  • Hand Tracking with MediaPipe
  • Mouse Control
    • Move mouse with index finger
    • Thumbs Up β†’ Single Click (after 0.75s)
    • Thumbs Up β†’ Double Click (after 2.25s, total 3 clicks including the first one)
  • Pause Mouse Movement by raising index + middle finger together
  • On-Screen Visualization
    • Green dots show which fingers are active
    • Debug text with landmark coordinates and click counter
  • Resizable Window β€” camera frame automatically adjusts to window size

πŸ“Έ Demo

(Insert GIF or screenshot of your program running here)


πŸš€ Installation

Clone this repository:

git clone https://github.com/yourusername/touchless-hand-tracking.git
cd touchless-hand-tracking

Install dependencies:

pip install opencv-python mediapipe pyautogui

▢️ Usage

Run the script:

python main.py

Controls:

πŸ‘‰ Index finger up β†’ Move mouse

✌️ Index + Middle finger up β†’ Pause mouse movement

πŸ‘ Thumbs up

  • Hold for 0.75s β†’ Left Click
  • Hold for 2.25s β†’ Double Click (so total 3 clicks)

❌ Press Q β†’ Quit the app

⚠️ Notes

Works best in good lighting with one hand visible

When the window is minimized, the program falls back to prevent resize crashes

Screen resolution is automatically detected for accurate mouse movement

πŸ› οΈ Built With

OpenCV – Computer Vision

MediaPipe – Hand Tracking

PyAutoGUI – Mouse Control

πŸ’š Future Improvements

Right-click gesture support

Scroll with finger gestures

Multi-hand support

About

Control your mouse without touching anything, this is for you if you often have a dirty hands.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages