Use built-in features or third-party apps to secure your keyboard
Whether it’s a cat lounging across your keyboard, a curious child pressing random keys, or a coworker poking around your desk, you might want to lock just your keyboard without locking your entire computer. Good news—it's totally doable. In this guide, we'll walk you through a few easy methods for locking your keyboard on both Windows and Mac systems.
Keyboard Locking MethodsFor Windows, download AutoHotkey Keyboard Locker by Sophice from GitHub, then press Ctrl+Alt+k to lock your keyboard. Mac users can get KeyboardCleanTool and simply tap the lock icon to disable keyboard input.
AutoHotkey Keyboard Locker (Windows)

Get a keyboard locking utility. Several of these tools are available online and are essentially AutoHotkey scripts bundled for ease of use. We’ll demonstrate how to use AutoHotkey Keyboard Locker by Sophice on GitHub, but you’re welcome to try any AHK-based option.
- Grab the latest version of AutoHotkey Keyboard Locker from GitHub. We suggest downloading the .exe file since using the source code requires additional software. The steps here are for the executable version.
- Other AHK Locker scripts exist that use different shortcuts (e.g., Ctrl + Alt + L). Installation is typically similar, but always follow the instructions provided with your download.
- Be cautious when downloading software—only use trusted sources.

Store the .exe file somewhere safe. Since AutoHotkey Keyboard Locker is a portable app, it doesn't need installation. You can place the executable in any folder—desktop, documents, or another secure spot—without worrying about it being deleted.

Launch the .exe file. After running it, you'll see a small notification in the bottom-right corner showing the keyboard lock shortcut.

Hit Ctrl+Alt+k to lock your keyboard. Your keyboard will be instantly disabled. You can also right-click the app's icon in the system tray and choose "Lock keyboard."

Type unlock to reactivate your keyboard. Alternatively, you can right-click the AutoHotkey Keyboard Locker icon in the system tray and choose "Unlock keyboard."

To close the program, right-click the keyboard locker icon in the system tray. From the menu, click Exit to shut down AutoHotkey Keyboard Locker. After that, pressing Ctrl + Alt + k will no longer lock the keyboard.
KeyboardCleanTool Application (Mac)

Download a Mac-compatible keyboard locking app. Tools for both Mac and Windows are available, and we'll focus on using KeyboardCleanTool by folivora.AI.
- Head over to the folivora.AI website and download the latest version of KeyboardCleanTool.
- Be sure to download only from sources you trust, especially when installing software from the internet.

Launch the KeyboardCleanTool app from your downloads folder. If macOS displays a warning, click Open to proceed. Only bypass this warning for apps from trusted sources.

Click Click to start cleaning mode/lock the keyboard!. This button is located at the top of the KeyboardCleanTool window and will instantly disable both your keyboard and TouchBar if you're using a MacBook.

To unlock your keyboard, click the same button at the top of the KeyboardCleanTool window again. If you'd like the app to lock the keyboard automatically when it opens, you can check the box labeled "Start cleaning mode immediately after starting this app."

Close the app by clicking the red circle in the top corner of the window. The keyboard will only stay locked while the app is running and the lock button is activated, but it’s a good habit to exit the app once you're finished.
Disabling the Keyboard Using Device Manager (Windows)

Launch Device Manager. The quickest way is to right-click the Windows icon in the bottom-left corner and choose Device Manager. Alternatively, type "Device Manager" into the search bar on your taskbar and click the matching result.

Expand the "Keyboards" dropdown. You'll see all keyboards currently connected to your PC. If you're unsure which one is yours, unplug your keyboard and reconnect it to identify the correct listing.
- Laptop users might see more than one keyboard listed in Device Manager. In that case, you may need to follow the steps for each keyboard listed.

Right-click your keyboard and choose Disable device. If that option isn’t available, click Uninstall device instead.

Re-enable the keyboard when you want to use it again. In Device Manager, just right-click the keyboard entry and select
Enable device.
- If you uninstalled it earlier, restart your PC—Windows will automatically reinstall the necessary driver on reboot.
Disconnect or Power Off Keyboard (Windows or macOS)

If your keyboard isn't built-in, simply unplug or power it down. This doesn't apply to most laptops, but some may offer a built-in switch to disable the keyboard. For USB keyboards, unplugging will disable them; for Bluetooth models, just
turn them off.
- While this method doesn't technically "lock" the keyboard, it makes it unusable until it’s reconnected or powered back on.