Guide
How to clean a MacBook keyboard without shutting it down
Keep your apps open and wipe the keys without typing into them.
Last updated: October 2026
The short answer
Lock the keyboard and trackpad instead of shutting down, then wipe the keys with a soft, dry cloth or use compressed air. macOS has no simple switch that turns off the built-in keyboard for cleaning, so this takes a small app.
Why the usual methods fall short
- Shutting down is free, and Apple recommends it before you wipe with a damp cloth. But your open work closes, and many MacBooks turn back on when a key is pressed.
- Sleep does not help, because pressing a key wakes the Mac.
- The lock screen does not help either. Keys go into the password field and the trackpad keeps working.
- A keyboard lock app keeps your work open and stops keys from reaching it. Several exist, some of them free, and some ask for Accessibility permission. CleanLock is one of them and needs no special permissions.
How to do it with CleanLock
- Click the CleanLock icon in the menu bar, or press Control + Option + Command + L.
- Pick a duration from 15 seconds to 5 minutes, or ∞ to stay locked until you unlock.
- Click Lock. The lock screen covers every connected display.
- Clean the keys. The lock opens when the timer ends, or press ESC three times to open it early.
- Open Keyboard Test from CleanLock and press each key to check that it still responds.
Cleaning the keys the way Apple describes
- Use only a soft, lint-free cloth. Avoid towels and paper towels.
- For compressed air, hold your Mac notebook at a 75-degree angle and spray from left to right, with the end of the straw about half an inch from the keyboard.
- Never spray liquid directly on the computer.
- If you want to use a damp cloth, shut down and unplug your Mac first, and dampen the cloth with water only.
What a lock like this does not cover
macOS handles the power button and Touch ID, brightness, volume and media keys itself, and CleanLock asks for no special permissions, so it cannot block them. Brightness or volume may change while you wipe, and some system-wide shortcuts, such as taking a screenshot, may still work. Wipe the power button and Touch ID without pressing down.