How giacomolaw/keylogger works
This repository contains three independent, platform-specific key-recording programs rather than a shared cross-platform runtime. In each, the principal workflow is startup, capture of keyboard events, conversion or formatting, and writing to a local log. Windows also records foreground-window context and rotates log files; macOS exposes a configurable log path and clear option; Linux uses pyxhook and writes a timestamped log. The source excerpts support these platform-specific flows; the macOS header declares interfaces and globals, while the Linux requirements file identifies the pyxhook dependency.
Main entry points: keylogger.py Logger runtime · klog_main.cpp Key formatting · keylogger.c Logger runtime
Components 14
Windows logger
- Logger runtime
windows/klog_main.cpp - Keyboard hook
windows/klog_main.cpp - Key formatting
windows/klog_main.cpp - Window context
windows/klog_main.cpp - Local log files
windows/klog_main.cpp
macOS logger
- Logger runtime
mac/keylogger.c - Event tap
mac/keylogger.c - Key conversion
mac/keylogger.c - Local log
mac/keylogger.c
Linux logger
- Logger runtime
linux/keylogger.py - Hook manager
linux/keylogger.py - Timestamped log
linux/keylogger.py
Other components
- Operator
- pyxhook library
Connections 14
- Operator → Logger runtime: runs
README.md - Operator → Logger runtime: runs
README.md - Operator → Logger runtime: runs
README.md - Logger runtime → Keyboard hook: installs hook
windows/klog_main.cpp - Keyboard hook → Key formatting: passes key
windows/klog_main.cpp - Key formatting → Window context: adds context
windows/klog_main.cpp - Key formatting → Local log files: writes entries
windows/klog_main.cpp - Logger runtime → Event tap: creates tap
mac/keylogger.c - Event tap → Key conversion: passes keycode
mac/keylogger.c - Key conversion → Local log: writes key text
mac/keylogger.c - Logger runtime → Hook manager: configures listener
linux/keylogger.py - Logger runtime → pyxhook library: uses library
linux/keylogger.py - Hook manager → Logger runtime: delivers events
linux/keylogger.py - Logger runtime → Timestamped log: appends keystrokes
linux/keylogger.py