How to Lock the Keyboard on a Mac: Real Ways
Last updated July 7, 2026
You want to lock the keyboard on your Mac, and you keep coming up empty. There is a reason for that.
macOS has no single button that locks just the keyboard. Apple never built one in, so you have to use a workaround.
The good news is there are a few reliable ways to do it, depending on why you want the keys locked. Here are the real options, from quickest to most complete.
Why is there no button to lock the keyboard on a Mac?
Apple designed macOS so the keyboard is always ready. There is no built in switch to freeze the keys on their own.
So the trick is to pick the method that matches your goal. Cleaning the keys, stopping a toddler or a cat from typing, and stepping away each have a different best answer.
Method 1: Lock the whole Mac when you step away
If you just want to walk away safely, lock the entire Mac.
- Press Command, Control, and Q at the same time.
- The screen goes to the lock screen right away.
- Type your password or use Touch ID to get back in.
This is the fastest built in option, and it protects your files too.
Method 2: Shut down to clean the keys safely
If you want to wipe the keyboard, the safest move is to turn the Mac off.
- Click the Apple menu in the top left corner.
- Click Shut Down.
- Wait for the Mac to power off fully.
- Clean the keys, then turn it back on.
With the Mac off, nothing you press does anything, so you can wipe every key without opening apps or deleting text.
Method 3: Block apps with Screen Time
Screen Time does not deaden the keys, but it can stop your typing from opening or changing anything. That is useful when a child or a guest is near the keyboard.
- Open the Apple menu, then System Settings.
- Click Screen Time in the left list.
- Click App Limits, then turn it on and add a limit for All Apps and Categories.
- With the limit active, apps are blocked, so stray key presses cannot do damage.
This is not a true keyboard lock, so for cleaning use the shut down method above or a cleaning app below. Screen Time works app by app, so if one app will not close on its own, see our guide on how to fully quit an app like Mail on a Mac.
Method 4: Use a free outside app to lock the keys
If you clean your keyboard often and want the screen on, a small free app made for this is the easiest path.
- Search your web browser for a Mac keyboard cleaning app such as KeyboardCleanTool.
- Download it from the maker site and open it.
- Give it accessibility permission when macOS asks, under System Settings, Privacy and Security, Accessibility.
- Click the button in the app to lock the keys, and click it again to free them.
These apps lock every key, including the top row, so you can wipe the whole board with the screen on.
What is the best way to lock a Mac keyboard?
It depends on your reason.
To step away, press Command, Control, Q.
To clean, shut the Mac down, or use a free cleaning app if you want the screen on.
To stop a child or a pet from doing damage during a movie, Screen Time blocks the apps, and a cleaning app locks the keys outright.
If your goal is to type without touching the keys at all, see our guide on entering your password on a Mac without the keyboard.
Frequently asked questions
Is there a keyboard lock shortcut on a Mac?
Not for the keyboard alone. Command, Control, Q locks the whole Mac, which is the closest built in shortcut.
How do I lock my Mac keyboard to clean it?
Shut the Mac down for the safest clean, or use a free keyboard cleaning app if you want the screen to stay on.
Does locking the screen lock the keyboard?
It stops your typing from reaching apps, but the keys still work at the login screen to enter your password. To fully deaden the keys, shut down or use a cleaning app.
Can I lock just the keyboard and still use the mouse?
Only with an outside app built for that. macOS has no built in way to lock the keys while keeping the trackpad live. If your Mac is frozen instead, our guide on force quitting a stuck app on a Mac may help.