Skip to main content

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

  1. Monitor keyboard input:
# Basic monitoring
sudo keystroke-sim monitor

# Advanced options
sudo keystroke-sim monitor --track-all --max-combo-keys 4
  1. 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

  1. Real-time Logging

    • Timestamps for all events
    • Key press and release tracking
    • Key combination detection
    • Organized daily log files
  2. Statistics Collection

    • Total keystroke count
    • Most frequent keys
    • Common key combinations
    • Usage patterns
  3. 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

  1. Basic Operations

    • Individual key presses
    • String typing
    • Hotkey combinations
    • Custom delays
  2. 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

  1. Data Security

    • Local logging only
    • No network transmission
    • Clear log file locations
  2. Transparency

    • All operations are logged
    • Statistics are saved locally
    • No hidden functionality

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: python -m pytest tests/
  5. Submit a pull request

Support

For issues, questions, or contributions:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keystroke_sim-0.2.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keystroke_sim-0.2.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

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

Hashes for keystroke_sim-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c607de5099561c7abca29bbe8366c82e59b7cef67677e550bb81a1c9dad789bf
MD5 e5fd4b8e787798fe665e9b437199fa1e
BLAKE2b-256 616477748fbab62e4e41ea5c06a8b7f0f77ceac064611e227e4be7f0277919f1

See more details on using hashes here.

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

Hashes for keystroke_sim-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97a851ddbda90ca3c4162d9c26e79d8454d40d8a520d36048b3c5176fc542518
MD5 8a85e504afab3e867a16c3e1d532c1b5
BLAKE2b-256 f17caf2153a13599536fa9afc16c58cb0ca6bc9641f471e8ff83c6c09864e85e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page