Clean your keyboard without typing gibberish.
A tiny Windows app that blocks every key press while it's open, so you can wipe, brush, and vacuum your keyboard without accidentally sending messages, closing windows, or triggering shortcuts.
- 🚫 Blocks all keys, including
Win,Alt+Tab,Alt+F4,Escand more - 🖱️ Unlock with the mouse, one click on Unlock and Exit
- 🔢 Live counter showing how many key presses were blocked
- ⏱️ Safety auto-unlock after 15 minutes (configurable)
- 📌 Always on top, so you can't lose the window while cleaning
- 🪶 Tiny and portable: a single ~80 KB
.exe, no installer, no dependencies - 🖥️ HiDPI aware and uses modern Windows visual styles
- Download
KeyboardLock.exefrom the Releases page. - Double-click it. The keyboard is locked immediately. 🔒
- Clean your keyboard to your heart's content. 🧽
- Click Unlock and Exit with your mouse. 🔓
KeyboardLock.exe [minutes]
| Command | Behavior |
|---|---|
KeyboardLock.exe |
Auto-unlock after the default 15 minutes |
KeyboardLock.exe 5 |
Auto-unlock after 5 minutes |
KeyboardLock.exe 0 |
No timeout, unlock manually with the mouse |
- 🛡️
Ctrl+Alt+Delcannot be blocked by any program. This is a Windows security feature and works as your emergency exit: open Task Manager from there and end Keyboard Lock. - 💻 Laptop power buttons and some Fn hardware keys are handled by firmware and can't be blocked in software. The touchpad and mouse keep working.
- 👑 Windows running as administrator (elevated windows) may still receive keystrokes. If that matters, run Keyboard Lock as administrator too.
- 🔔 The
.exeis unsigned and uses a keyboard hook, so Windows SmartScreen or some antivirus tools may show a warning. Click More info → Run anyway, or build it yourself from source (below). The code is short and easy to review.
The app installs a low-level keyboard hook (WH_KEYBOARD_LL) and returns a non-zero value from the hook procedure for every event, which tells Windows to drop the key press before any application sees it. When the app exits, the hook is removed and your keyboard works normally again.
No data is recorded, stored, or sent anywhere. The only thing the app keeps is a counter of blocked key presses, shown in the window.
You only need a C compiler that can target Windows. The easiest cross-platform option is Zig, which works on Windows, Linux, and macOS:
pip install ziglang
python -m ziglang cc -target x86_64-windows-gnu -O2 -s -Wl,--subsystem,windows KeyboardLock.c app.rc -o KeyboardLock.exe -luser32 -lgdi32 -lcomctl32| File | Purpose |
|---|---|
KeyboardLock.c |
The entire application |
app.manifest |
Enables modern visual styles and HiDPI support |
app.rc |
Embeds the manifest into the executable |
Issues and pull requests are welcome! Ideas: custom timeout in the UI, a tray icon, a "lock mouse too" option, translations. 🌍
Released under the MIT License.
Made with ☕ for everyone who has ever spilled crumbs into their keyboard.