Skip to content

Repository files navigation

Keyboard Blocker

Copyright © 2025 Pavel Bashkardin

image

MIT License SourceForge Rising Star

Description

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.

Key Features

  • 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 unblock to 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.

Usage

image
  • Block/Unblock:
    • Right-click the tray icon and choose "Block" or "Unblock".
    • Or, simply type unblock on your keyboard to unblock the keyboard instantly.
  • Exit:
    • Right-click the tray icon and select "Exit".
image
  • Notifications:
    • Left-click the tray icon to show the current blocking state.
image

The program is designed to be as unobtrusive as possible: no windows, only a tray icon and occasional balloons.

Installation

Using the Installer

  • Run Setup.exe to install Keyboard Blocker.
  • The program will be extracted to %APPDATA%\Keyblock and added to Windows startup.

If you want, you can modify the source code and create your own binaries.

Uninstallation

  • 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).

Building from Source

Compilation Requirements

  • Windows operating system.

  • MinGW‑w64 compiler (TDM‑GCC recommended) with windres (resource compiler) and objdump (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 the set PATH= line in build.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 the set PATH= line in buildsfx.bat if it necessary.

How to Build

Simply double‑click build.bat or run it from the command prompt.

The script will:

  1. Delete old object files and the previous executable.
  2. Compile all resources script.
  3. Compiles the main application and uninstaller.
  4. Link everything to executable file with optimizations for small size.
  5. Display the list of imported DLLs (to verify no unexpected dependencies).
  6. If UPX is found, compress the executable (optional).
  7. Create an SFX archive that includes all necessary files and an installation script. Ensure WinRAR is installed and the path in buildsfx.bat is 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.

License

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.

Author

Pavel Bashkardin

For questions or suggestions, feel free to contact the author via GitHub.

About

Windows application to block keyboard input

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages