A graphical application for Linux that toggles keyboard input blocking with a single button. Perfect if your toddler likes to press a lot of buttons during video calls.
- Simple one-button toggle interface built with PyQt6
- Disables/enables all keyboard input at the system level
- Status indicator showing current state
- Works on Wayland and X11
- Python 3.7+
- PyQt6
- evdev (Linux kernel input device library)
On Ubuntu/Debian:
sudo apt-get install python3 python3-pip libevdev-dev
pip install -r requirements.txtOn Fedora:
sudo dnf install python3 python3-pip libevdev-devel
pip install -r requirements.txtOn Arch:
sudo pacman -S python3 libevdev python-pyqt6 python-evdevThe application requires elevated privileges to access input devices:
sudo -E python3 kb-block.pyOr make it executable:
chmod +x kb-block.py
sudo -E ./kb-block.py- Launch the application with
sudo -E - Click "Block Keyboard" to disable all keyboard input
- The button turns red and shows "Unblock Keyboard"
- Status shows "Keyboard BLOCKED ⚠"
- Click "Unblock Keyboard" to re-enable keyboard input
- The button returns to normal
- Status shows "Keyboard enabled ✓"
Note: When keyboard is blocked, you'll need to use:
- Mouse to unblock via the button
- External input devices (if available)
- Or kill the process from another terminal:
sudo killall -9 python3(or the specific PID)
The application uses the evdev library to grab input devices at the kernel level:
grab()- Prevents the keyboard from sending any eventsungrab()- Restores keyboard input
This works with both X11 and Wayland display servers.
The application requires sudo because it needs to directly access
/dev/input/event* devices.
If you want to run without sudo, you can add your user to the input group:
sudo usermod -a -G input $USER
# Log out and back in for the change to take effectHowever, this is less secure as it grants all users in the input group broad input device access.
- Ensure you're running with
sudo -E - Check that keyboard input devices exist:
ls -la /dev/input/event*
- Run with
sudo -E - Or add your user to the input group (see Permissions Note above)
- Multiple keyboard devices may exist; the app grabs the primary one
- Try unblocking and re-blocking
This project is licensed under the Zlib license (see LICENSE file for more information).