A simple, effective utility for Linux to lock your keyboard input while keeping your screen visible and the system running.
- Cat Proofing: Stop your cat from walking across your keyboard and sending unfinished emails, closing windows, or pausing your music.
- Disable Laptop Keyboard: If you are using another keyboard disable the internal laptop one to prevent accidental keypresses.
- Child Safety: Allow your toddler to watch videos or look at photos without worrying about them accidentally deleting files or stopping playback.
- Cleaning: Wipe down your keyboard without needing to shut down your computer or unplug the device.
- System-Level Lock: Uses
evdevto grab the keyboard device directly, ensuring input is blocked for all applications. - Configurable Unlock: Set your own unlock key combination (Default:
CTRL + Q). - Visual Indicator: Clear GUI feedback showing when the keyboard is locked.
- Wayland & X11 Support: Works independently of the display server by interacting with kernel input devices.
A PKGBUILD is provided for easy installation on Arch Linux.
makepkg -sireload the udev rules after install
sudo udevadm control --reload-rules && sudo udevadm trigger --subsystem-match=input --action=change If you aren't in the input group add your user
sudo usermod -aG input $USERYou can build and install the application manually using the provided script.
You will need the Rust toolchain (cargo) and development libraries for Wayland and OpenGL.
Debian / Ubuntu / Mint:
sudo apt update
sudo apt install build-essential libxkbcommon-dev libwayland-dev libglvnd-dev pkg-config libssl-dev policykit-1
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shFedora / RHEL:
sudo dnf install gcc libxkbcommon-devel wayland-devel libglvnd-devel openssl-devel polkit
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shClone the repository and run the install script:
chmod +x install.sh
./install.shThis script will compile the application, install it to /usr/local/bin, and install a udev rule to allow running without root.
If you aren't in the input group add your user
sudo usermod -aG input $USER- Open your application menu and launch Keyboard Locker.
- The application should open immediately (no password required).
- Once the window opens, you can optionally change the unlock key (Default is
Q). - Click 🔒 LOCK NOW.
- Your keyboard is now locked. To unlock, press
Left Ctrl+[Your Configured Key](e.g.,Ctrl + Q).
If you installed via the install.sh script, you can remove the files manually:
sudo rm /usr/local/bin/keyboard-locker
sudo rm /usr/share/pixmaps/keyboard-locker.png
sudo rm /usr/share/applications/keyboard-locker.desktop
sudo rm /etc/udev/rules.d/99-keyboard-locker.rulesIf the application launches but the dropdown is empty or shows a warning, it is likely a permission issue. The application needs direct access to /dev/input/ devices
Fix:
- Add your user to the input group:
sudo usermod -aG input $USER- Reboot your computer.
Note: Simply logging out and back in is often insufficient for device node permissions to update.
If you click "LOCK NOW" and it immediately unlocks or shows an error:
- Exclusive Access: Another application may have already "grabbed" the device.
- Device State: The keyboard might have disconnected or changed paths (e.g., KVM switch toggled). Try re-selecting the device from the dropdown.
If the unlock combination is not working:
- Ensure you are holding CTRL (Left or Right) while pressing the configured key.
- The default key is Q (i.e.,
CTRL + Q). - If you customized the key (e.g., to 'X'), use
CTRL + X. - Emergency Unlock: Unplugging the keyboard will force the application to release the handle. You can then plug it back in to use it normally.
This application uses evdev (kernel-level input drivers). This means it works on Wayland (GNOME, Sway, Hyprland) where traditional X11 screen lockers or input blockers often fail.
