Cross-platform keyboard input simulation and monitoring
Project description
KeystrokeSimulator
A comprehensive Python library for keyboard input simulation and monitoring, developed by Bassem Abidi (bassem.abidi@example.com).
Features
Keystroke Simulation
- 🎯 Cross-platform support (Windows, macOS, Linux)
- ⌨️ Simulate individual keystrokes
- 📝 Type strings with customizable delays
- 🔥 Support for hotkey combinations
- 🔧 Custom keyboard layout definitions
Keyboard Monitoring
- 📊 Real-time keystroke logging
- 📈 Detailed keystroke statistics
- 🔍 Key combination tracking
- 📅 Date-organized logs
- 📊 Usage analytics
Quick Start
Installation
pip install keystroke-sim
Command Line Usage
- Monitor keyboard input:
# Basic monitoring
sudo keystroke-sim monitor
# Advanced options
sudo keystroke-sim monitor --track-all --max-combo-keys 4
- Simulate keystrokes:
# Type text
keystroke-sim simulate --text "Hello, World!" --delay 0.1
# Press hotkey
keystroke-sim simulate --hotkey ctrl c
Python API Usage
from keystroke_sim import KeystrokeSimulator, KeyboardMonitor
# Simulate keystrokes
sim = KeystrokeSimulator()
sim.type_string("Hello, World!", delay=0.1)
sim.press_hotkey(['ctrl', 'c'])
# Monitor keyboard
monitor = KeyboardMonitor()
monitor.start() # Starts monitoring
Features in Detail
Keyboard Monitoring
-
Real-time Logging
- Timestamps for all events
- Key press and release tracking
- Key combination detection
- Organized daily log files
-
Statistics Collection
- Total keystroke count
- Most frequent keys
- Common key combinations
- Usage patterns
-
Data Organization
logs/ ├── 2024-01-15/ │ ├── keystrokes_123456.log │ └── keystrokes_123456_stats.json └── 2024-01-16/ ├── keystrokes_234567.log └── keystrokes_234567_stats.json
Keystroke Simulation
-
Basic Operations
- Individual key presses
- String typing
- Hotkey combinations
- Custom delays
-
Custom Layouts
layout = { 'special_key': 'enter', 'custom_combo': ['ctrl', 'shift', 'x'] } sim.set_keyboard_layout(layout)
Configuration
Monitor Configuration Options
keystroke-sim monitor [OPTIONS]
Options:
--log-file PATH Custom log file path
--no-combinations Disable logging of key combinations
--no-stats Disable collection of keystroke statistics
--track-all Track all keys including modifiers
--max-combo-keys N Maximum keys in combinations (default: 3)
Simulation Configuration Options
keystroke-sim simulate [OPTIONS]
Options:
--text TEXT Text to type
--hotkey KEY... Hotkey combination (e.g., ctrl c)
--delay SECONDS Delay between keystrokes (default: 0.1)
Platform-Specific Requirements
Linux
# Run with sudo for keyboard access
sudo keystroke-sim monitor
macOS
- Grant accessibility permissions
- Allow terminal access in Security & Privacy
Windows
- Run as administrator for certain applications
Safety and Privacy
-
Data Security
- Local logging only
- No network transmission
- Clear log file locations
-
Transparency
- All operations are logged
- Statistics are saved locally
- No hidden functionality
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
python -m pytest tests/ - Submit a pull request
Support
For issues, questions, or contributions:
- GitHub Issues: https://github.com/bassemabidi/keystroke_sim/issues
- Email: bassem.abidi@example.com
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Bassem Abidi (bassem.abidi@example.com)
Version History
See CHANGELOG.md for version history and changes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keystroke_sim-0.2.0.tar.gz.
File metadata
- Download URL: keystroke_sim-0.2.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c607de5099561c7abca29bbe8366c82e59b7cef67677e550bb81a1c9dad789bf
|
|
| MD5 |
e5fd4b8e787798fe665e9b437199fa1e
|
|
| BLAKE2b-256 |
616477748fbab62e4e41ea5c06a8b7f0f77ceac064611e227e4be7f0277919f1
|
File details
Details for the file keystroke_sim-0.2.0-py3-none-any.whl.
File metadata
- Download URL: keystroke_sim-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97a851ddbda90ca3c4162d9c26e79d8454d40d8a520d36048b3c5176fc542518
|
|
| MD5 |
8a85e504afab3e867a16c3e1d532c1b5
|
|
| BLAKE2b-256 |
f17caf2153a13599536fa9afc16c58cb0ca6bc9641f471e8ff83c6c09864e85e
|