Skip to main content

Cross-platform keyboard cleaning utility — lock your keyboard, wipe it clean.

Project description

KeyClean

Cross-platform keyboard cleaning utility. Locks the keyboard, visualizes keypresses on a full ISO 105-key layout, and suppresses input to the OS — so you can wipe your physical keyboard without triggering commands.

Vibe-coded using Claude Sonnet 4.6.

Installation

pip install keyclean

Platform extras for stronger input suppression:

pip install "keyclean[grab]"        # pynput (macOS / Windows)
pip install "keyclean[grab,linux]"  # pynput + python-xlib (Linux X11)

Usage

keyclean
# or
python -m keyclean
# or from the dev tree
uv run keyclean

The application launches fullscreen. All keypresses are shown on the virtual keyboard and counted but have no effect on the OS.

Exit

  • Type keys are clean on the physical keyboard, or
  • Click the Done button with the mouse.

Platform Notes

Platform Suppression method Notes
Linux (X11) XGrabKeyboard Full suppression while window is focused
Linux (Wayland) SDL2 shortcuts_inhibit Best-effort; Ctrl+Alt+F* cannot be blocked
macOS pynput / CGEventTap Requires Accessibility permission
Windows pynput / LowLevelHook Ctrl+Alt+Del cannot be blocked (by design)

Without the optional extras the app falls back to pygame-only mode (fullscreen), which prevents most accidental input but a warning banner is displayed.

Development

Clone and set up the dev environment with uv:

git clone https://github.com/gunchev/keyclean
cd keyclean
uv sync --group dev              # core dev tools + pynput
uv sync --group dev --extra linux  # also install python-xlib (Linux X11)

Run the test suite:

uv run pytest
# or via make
make test

Lint and format:

make lint        # pylint
make pep8format  # autopep8

Build a wheel:

make build

Publish to PyPI / TestPyPI:

make upload       # PyPI
make test_upload  # TestPyPI

Dependency groups:

Command Installs
uv sync --group dev dev toolchain (pytest, pylint, autopep8, tox, twine, pynput)
uv sync --extra grab pynput (runtime, macOS/Windows suppression)
uv sync --extra linux python-xlib (runtime, Linux X11 suppression)
uv sync --extra macos pyobjc-framework-Quartz (runtime, macOS)

License

This is free and unencumbered software released into the public domain. See LICENSE or https://unlicense.org.

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

keyclean-0.9.0.tar.gz (358.6 kB view details)

Uploaded Source

Built Distribution

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

keyclean-0.9.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file keyclean-0.9.0.tar.gz.

File metadata

  • Download URL: keyclean-0.9.0.tar.gz
  • Upload date:
  • Size: 358.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for keyclean-0.9.0.tar.gz
Algorithm Hash digest
SHA256 67e1d104acea953765f76346fde407e6c63b4dd1f44bf795dcd466a3bc101609
MD5 13fa9702b444f0123a7fd72500a44e78
BLAKE2b-256 b9499c93d63615ab730b5a8b283fb6fe93a1df5eec5e70d0929fc1e84bf07c3a

See more details on using hashes here.

File details

Details for the file keyclean-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: keyclean-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for keyclean-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90a13c91f0405b2e1b9489cb7696d767a94a95b78d0707d08f7364739290f1d6
MD5 5ffd42f2960e5f595308563eb81423c5
BLAKE2b-256 60c48d9d8e1dea6c00c88f7fc117da50b15260aa14b8b12173d666234bd9c31d

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