Control your mouse without touching it! Virtual Mouse is a Python-powered gesture-control system using MediaPipe and OpenCV. Move your cursor, click, and take screenshots — all with your hand. Built for fun, accessibility, and real-world AI practice.
- virtual_mouse.ipynb – main notebook
- util.py – helper functions (distance, angle)
-
Hand landmarks are provided by MediaPipe; the notebook converts landmark coordinates into gestures.
-
Utility functions get_angle and get_distance (in util.py) compute angles between joints and distances between landmarks — they are used to detect different gestures.
-Gesture rules (from the code):
-
Move mouse: when thumb–index distance is small (thumb_index_dist < 50) and a certain finger angle is open (> 90°) → move cursor to index fingertip.
-
Left click: specific finger angle arrangement + thumb_index_dist > 50.
-
Right click: swapped angle arrangement + thumb_index_dist > 50.
-
Double click: both key angles are small (< 50) and thumb_index_dist > 50.
-
Screenshot: both key angles are small and thumb_index_dist < 50 (saves my_screenshot_.png).
[Exact angle checks and threshold values are implemented in the notebook functions is_left_click, is_right_click, is_double_click, is_screenshot, and detect_gesture.]