This guide explains how to run and use the Touchless Computer Control application.
Activate the virtual environment if it is not already active.
.venv\Scripts\Activate.ps1Run the application from the project root:
python main.py
The application displays a menu:
- Virtual Mouse
- Gesture Keyboard
Enter the number corresponding to the desired mode.
Select:
1
A camera window named Virtual Mouse will open.
The application uses hand tracking to detect gestures and control the system cursor.
- The index fingertip is mapped to the screen position.
- Move your index finger to move the mouse cursor.
- Bring the thumb and index fingertips close together.
Thumb + Index
↓
Pinch
↓
Left Mouse Click
A cooldown prevents repeated clicks from being triggered too quickly.
- Raise the index and middle fingers.
Index + Middle
↓
Drag
The left mouse button remains pressed while the drag gesture is active.
When the gesture changes or the hand disappears, the mouse button is automatically released.
Select:
2
A camera window named Gesture Keyboard will open.
The application detects the hand, identifies the gesture, and maps it to a keyboard action based on the active keyboard profile.
The current status overlay displays information similar to:
Hand: Right
Gesture: Index + Middle
Action: Right Arrow
The exact actions depend on the selected keyboard profile.
The default profile includes gestures such as:
Left Hand
├── Index + Middle → Left Arrow
├── Thumb → Space
└── Index → Alt + Tab
Right Hand
├── Index + Middle → Right Arrow
├── Thumb → Escape
└── Index → F5
More details about available controls are available in:
The active keyboard profile is configured in:
src/config.py
For example:
KEYBOARD_PROFILE = "default"
The project currently includes:
default
presentation
To change profiles, modify:
KEYBOARD_PROFILE = "presentation"
Then restart the application.
Both controller windows can be closed in two ways.
With the camera window selected, press: Q
Click the X button in the camera window.
The application releases the camera and closes the MediaPipe resources before terminating.
For more reliable hand detection:
- Use adequate lighting.
- Keep your hand clearly visible to the camera.
- Avoid a heavily cluttered background when possible.
- Keep the hand within the camera frame.
- Avoid extremely fast movements.
- Maintain a reasonable distance from the camera.