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 cleanon 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.
Metadata
Release files for keyclean 0.9.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| keyclean-0.9.10.tar.gz | 365.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| keyclean-0.9.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 391.6 kB
Release files / keyclean-0.9.10.tar.gz
| Download URL | keyclean-0.9.10.tar.gz |
|---|---|
| Size | 365.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50fbedc6b4def7d8d7783abe42b4d2d2e4505ec3bb1c43a8fab4414e629264b8
|
|
BLAKE2b-256 checksum How to use checksums |
6b349f2d1997aedab097a1b9aa2ada82f891ded7d38eadc9fe87193c2b39ec59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / keyclean-0.9.10-py3-none-any.whl
| Download URL | keyclean-0.9.10-py3-none-any.whl |
|---|---|
| Size | 26.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c7b8d2eaa330ac5e89e802487d2537c12094be18c5f161d943f89b50ae0b194a
|
|
BLAKE2b-256 checksum How to use checksums |
53c7834783a5302042fe1753fc2ed3526a4bdecb70c1265a0f166c394a715388
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|