This Python script utilizes the ctypes
and pynput
libraries to lock the keyboard input and prevent any accidental keystrokes. It's particularly useful in scenarios where non-users, like toddlers or pets, might come into contact with the keyboard, ensuring that their playful activities don't cause unintended actions on the computer.
- Keyboard Lock: Prevents all keyboard input until the script is terminated.
- Safe Termination: Allows the script to be safely terminated by pressing the spacebar five times rapidly.
- Admin Privileges: Requests admin permissions to ensure it can block input effectively.
- Child-Proofing: When toddlers are playing near a computer, this script can prevent them from sending emails, deleting files, or performing other unintended operations.
- Pet Safety: Pets, especially cats, are known to walk on keyboards. This script ensures they don't disrupt your work.
- Cleaning Mode: When cleaning your keyboard, you can run this script to avoid inputting random commands.
- Ensure you have
Python
and thepynput
library installed. - Run the script with administrator privileges.
- The keyboard will be locked immediately.
- To unlock, press the spacebar five times quickly.
This script requires administrative privileges to run effectively. Use it responsibly, and ensure that it's only used in appropriate scenarios.