Skip to content

kivok.py is a fun Python script that lets you control your keyboard with simple head nods. Perfect for hands-free TikTok scrolling, accessibility experiments, or just a geeky hack to impress your friends.

Notifications You must be signed in to change notification settings

69lihtajc96/kivok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kivok banner

🎥 kivok.py — head nod keyboard control

Kivok

🇷🇺 Russian

kivok.py is a Python script that tracks head movements via webcam and converts sharp nods into key presses.
Useful for experimenting with hands-free interfaces, accessibility solutions, or just as a fun hack.

kivok banner


⚡ Features

  • Real-time face tracking with OpenCV.
  • Tracking activation via a “blink” (brief disappearance of the face from the camera).
  • Detection of sharp up/down nods.
  • Keyboard emulation (default: arrow keys and ).
  • Sound signal when tracking is activated.
  • Debug mode with visualization (face bounding box, tracking status).

🔧 Dependencies

System utilities for key emulation:

For sound: paplay (PulseAudio).


🚀 Installation

# Python dependencies
pip install --user opencv-python numpy

# For Wayland
sudo apt install wtype

# For X11
sudo apt install xdotool

# For sound
sudo apt install pulseaudio-utils

▶️ Run

python3 kivok.py

Press q in the camera window to quit.


⚙️ Configuration

At the beginning of the file you can adjust parameters:

  • BLINK_DURATION — “blink” time for activation.
  • MOVEMENT_THRESHOLD — nod sensitivity (pixels).
  • COOLDOWN_DURATION — minimum delay between actions.
  • SOUND_FILE — path to the sound file for activation.
  • DEBUG_VISUALS — enable/disable visualization.

🧩 Limitations

  • Uses Haar Cascade (legacy face detector, sensitive to lighting). For higher accuracy use Mediapipe.
  • Works only with one camera (default: /dev/video0).
  • Requires external utilities (wtype or xdotool).

📌 Example use cases

  • Hands-free navigation through PDFs or browsers (arrow up/down).
  • Controlling a presentation.
  • Testing accessibility interfaces.

About

kivok.py is a fun Python script that lets you control your keyboard with simple head nods. Perfect for hands-free TikTok scrolling, accessibility experiments, or just a geeky hack to impress your friends.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages