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

How to do it with CleanLock

  1. Click the CleanLock icon in the menu bar, or press Control + Option + Command + L.
  2. Pick a duration from 15 seconds to 5 minutes, or ∞ to stay locked until you unlock.
  3. Click Lock. The lock screen covers every connected display.
  4. Clean the keys. The lock opens when the timer ends, or press ESC three times to open it early.
  5. Open Keyboard Test from CleanLock and press each key to check that it still responds.

Cleaning the keys the way Apple describes

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.

Sources