Copyright © 2025 Pavel Bashkardin
Keyboard Blocker is a lightweight Windows utility for blocking keyboard input. It works as a simple keyboard blocker that can temporarily disable the keyboard and prevent accidental keystrokes while watching videos, giving presentations, or when a child is using the computer. It requires no administrator rights and runs silently in the Windows system tray (near the clock).
The program uses a low-level Windows keyboard hook (WH_KEYBOARD_LL) to intercept and suppress keyboard input before it reaches applications. Unlike solutions that disable the keyboard device itself, Keyboard Blocker is a small user-mode utility that can disable keyboard input without installing drivers or requiring external runtime components.
- Small and Fast: Designed to have minimal memory usage and startup overhead.
- System Tray Integration: Runs in the background with a tray icon.
- Keyword Unblocking: Type
unblockto unblock the keyboard at any time. - Manual Control: Right-click the tray icon to block/unblock or exit.
- Registry Persistence: Remembers the last blocking state.
- Self-Contained Installer: Easy installation and uninstallation via
Setup.exe. - No Admin Rights Required: Works without administrator privileges.
- Native WinAPI Application: A lightweight standalone Windows executable built directly with WinAPI, with no external frameworks or runtime dependencies.
- Block/Unblock:
- Right-click the tray icon and choose "Block" or "Unblock".
- Or, simply type
unblockon your keyboard to unblock the keyboard instantly.
- Exit:
- Right-click the tray icon and select "Exit".
- Notifications:
- Left-click the tray icon to show the current blocking state.
The program is designed to be as unobtrusive as possible: no windows, only a tray icon and occasional balloons.
- Run Setup.exe to install Keyboard Blocker.
- The program will be extracted to
%APPDATA%\Keyblockand added to Windows startup.
If you want, you can modify the source code and create your own binaries.
- Via Installer:
- Open Apps & Features (or Programs and Features).
- Find Keyboard Blocker and click Uninstall.
- Manual Removal:
- Delete the installation folder (
%APPDATA%\Keyblock). - Remove the "Keyboard Blocker" entry from Windows startup (via Task Manager or Registry Editor).
- Delete the installation folder (
-
Windows operating system.
-
MinGW‑w64 compiler (TDM‑GCC recommended) with
windres(resource compiler) andobjdump(usually included). The provided build script assumes the compiler is installed at:C:\Program Files\TDM-GCC-64\bin. If your compiler is located elsewhere, edit theset PATH=line inbuild.bat. -
Optional:
- UPX or UPX on SourceForge (Ultimate Packer for eXecutables) for further size reduction.
- WinRAR Default path:
C:\Program Files\WinRAR\WinRAR.exe. Change theset PATH=line inbuildsfx.batif it necessary.
Simply double‑click build.bat or run it from the command prompt.
The script will:
- Delete old object files and the previous executable.
- Compile all resources script.
- Compiles the main application and uninstaller.
- Link everything to executable file with optimizations for small size.
- Display the list of imported DLLs (to verify no unexpected dependencies).
- If UPX is found, compress the executable (optional).
- Create an SFX archive that includes all necessary files and an installation script. Ensure WinRAR is installed and the path in
buildsfx.batis correctly set to the default or your custom location.
After a successful build you will find keyblock.exe, uninstall.exe and setup.exe in the same folder.
This project is licensed under the MIT License. See the LICENSE file or the source code headers for details. In short, you may use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, provided that the copyright notice and permission notice appear in all copies.
Pavel Bashkardin
For questions or suggestions, feel free to contact the author via GitHub.
