โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Type at 200 WPM โ using only your hands in mid-air. โ
โ No physical keyboard. No desk. Just you and the camera. โ
โ โ Tcode-Motion โก โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
A high-performance, augmented reality virtual keyboard controlled by AI hand gestures and mouse input. Powered by OpenCV and MediaPipe, it overlays a Ghost HUD keyboard on your screen and tracks your finger movements in real-time โ letting you type in any Windows application without ever touching a physical keyboard.
๐ฏ Point your finger. Tap. It types. That's it. Welcome to spatial computing.
| โก Feature | ๐ Description |
|---|---|
| ๐ป Ghost HUD Mode | Uses Windows ctypes API โ Always on Top + No-Focus. Types into ANY app without stealing window focus |
| ๐ฏ Precision Strike Typing | AI detects a "click" from decisive downward fingertip motion โ Binary-State Trigger |
| โก 200 WPM Capable | Ultra-low latency with 120ms debounce timer + high-speed tracking (alpha=0.92) |
| โจ๏ธ Full HP Layout | Function Row (F1-F12), Navigation cluster, full Numpad โ complete keyboard |
| ๐๏ธ Dual-Hand Support | Independent tracking for all 8 fingers (Index to Pinky) across both hands |
| ๐จ Professional HUD UI | Semi-transparent Navy-Glass aesthetic with Electric Cyan borders + Orange status indicators |
| ๐ Hybrid Control | Switch between AI Hand Gestures and Mouse Clicks instantly |
| โฑ๏ธ Dwell Trigger | Hold finger over key for 0.6s โ visual progress bar fills โ auto-types |
Uses Depth-Aware Dynamic Thresholding โ scales sensitivity to your hand's distance from the camera:
hand_scale = dist(wrist, middle_finger_base)
tap_threshold = hand_scale * 0.08A keystroke fires if a finger moves downward by more than 8% of the hand's size โ works consistently whether your hand is near or far from the camera.
Hold a finger over any key for 0.6 seconds โ a visual progress bar fills inside the key โ keystroke fires automatically. Perfect for accessibility.
The HUD window is rendered invisible to the Windows Focus Manager:
| Flag | Effect |
|---|---|
WS_EX_NOACTIVATE |
Prevents window from stealing foreground focus when clicked |
WS_EX_TOPMOST |
Keeps HUD above all other applications |
WS_EX_APPWINDOW |
Keeps it visible in Taskbar |
| Mode | Behaviour |
|---|---|
| Normal Mode | Media Controls โ Emoji Panel, Brightness, Volume, Mic Mute, Media Prev/Play/Next |
| Fn-Locked Mode | Standard Windows F1-F12 keys |
| Mode | Behaviour |
|---|---|
| NumLock ON | Standard numeric entry (0-9, . , Enter) |
| NumLock OFF | Navigation Cluster โ Home, End, PgUp, PgDn, Arrows, Insert, Delete |
- Pwr โ Top right. Instantly closes the Virtual Keyboard
- Shift / Ctrl / Alt โ Sticky toggles. Click once to lock, click again to release
| Library | Purpose |
|---|---|
| OpenCV | Camera feed capture, frame rendering, AR overlay |
| MediaPipe | Real-time AI hand landmark detection (21 points per hand) |
| NumPy | Geometry math โ distance calculations, thresholding |
| PyAutoGUI | Injects real keystrokes into active Windows applications |
| ctypes | Windows API โ Ghost HUD window flags |
- Windows 10 or 11
- Python 3.10+
- Standard webcam
# 1. Clone the repository
git clone https://github.com/Tcode-Motion/virtual-keyboard.git
cd virtual-keyboard
# 2. Install dependencies
pip install opencv-python mediapipe pyautogui numpy
# 3. Run the application
python virtual_keyboard_v2_main.pyStep 1 โ Run the script โ Ghost HUD keyboard appears on screen
Step 2 โ Position hands in front of webcam
โ Glowing MediaPipe landmarks overlay your fingers
Step 3 โ Use a quick "pecking" tap motion toward camera to type
OR simply click any key with your mouse
Step 4 โ Click into any app (Notepad, Chrome, Discord, Games)
โ Virtual Keyboard injects text directly โ globally
Step 5 โ Exit: click Pwr button (top right) or press Q
virtual-keyboard/
โโโ virtual_keyboard_v2_main.py # Main entry point โ run this
โโโ README.md
| Requirement | Spec |
|---|---|
| OS | Windows 10 / 11 (Ghost HUD ctypes required) |
| Python | 3.10 or higher |
| Hardware | Standard webcam |
| Dependencies | opencv-python, mediapipe, pyautogui, numpy |
Contributions welcome โ especially for:
-
๐ฏ Gesture smoothing improvements
-
๐จ HUD aesthetic upgrades
-
๐ง Linux/macOS port (replacing ctypes with cross-platform alternative)
-
โญ Star the repo if you like it!
-
๐ Open an issue for bugs
-
๐ง Submit a PR for improvements
This project is licensed under the MIT License.