A Python-based activity monitoring tool that logs keyboard inputs, mouse events, clipboard actions, and active window changes with timestamps.
- Keyboard Logging: Captures typed text buffer upon pressing Space, Enter, or Tab, as well as special key events.
- Clipboard Monitoring: Records text copied (Ctrl+C) or pasted (Ctrl+V).
- Mouse Tracking: Logs left/right clicks with screen coordinates and scroll directions.
- Window Tracking: Detects the active window title and records window switching events.
- Hourly Log Rotation: Automatically creates log files named by date and hour (
activity_log_YYYYMMDD_HH.txt).
- Python 3.6 or higher
- Required Python packages:
pynputpygetwindowpyperclip
Install all required dependencies via pip:
pip install pynput pygetwindow pyperclip
Run the script from your terminal or command prompt:
python main.py
To stop the logger, press Ctrl+C in the terminal. Any remaining text in the keyboard buffer will be written to the log file before exiting.
Log entries are saved in the working directory. Each entry follows this structure:
Timestamp | Window Title | Action/Event Details | Time Since Last Event
2026-05-12 14:30:00 | Window: Google Chrome | Text: hello world [SPACE] | Time Since Last: 0.45s
2026-05-12 14:30:02 | Window: Visual Studio Code | Clipboard Copy: sample code | Time Since Last: 2.10s
2026-05-12 14:30:05 | Window: Visual Studio Code | Mouse Left Click at (450, 320) | Time Since Last: 3.00s
This software is developed strictly for personal, educational, or authorized activity tracking purposes. The author accepts no responsibility or liability for any illegal, unauthorized, or malicious use of this project.