How to Lock Your Mac Keyboard and Trackpad for Cleaning (2026)

12 min read

Switching to Mac is reader-supported. We may earn a commission when you buy through links on our site. Learn more.

When you wipe down your MacBook, every accidental keypress still reaches whatever app is open. That can mean random shortcuts, closed windows, or a half-typed message sent to your boss. This guide shows you how to lock your Mac keyboard and trackpad for cleaning, using either a full shutdown or a free app called KeyboardCleanTool.

Here’s the short answer: Apple doesn’t offer a keyboard or trackpad lock for cleaning; its own cleaning guidance tells you to shut down. You can shut the Mac down, which is the safest option and what Apple’s cleaning guidance calls for. Or you can use KeyboardCleanTool, which is quicker because you don’t have to restart afterward. Below you’ll find both methods, plus why Lock Screen and Sleep don’t solve the problem.

What Is KeyboardCleanTool?

KeyboardCleanTool is a free utility from folivora.ai, the developer behind BetterTouchTool. When you start a cleaning session, it darkens the screen and blocks keyboard input. The current version (version 8) can also block trackpad and mouse clicks. It shows the elapsed time while it’s active, keeps your display from sleeping mid-wipe, and can unlock automatically after a timer.

To unlock, you use the trackpad or mouse, not the keyboard. That’s deliberate. If a key combo could unlock it, a toddler or cat walking across the keys might hit it by accident.

Before You Begin

Make sure you have:

  • A Mac running macOS 13 Ventura or later for the current KeyboardCleanTool version 8 (the older, keyboard-only version 7 supports macOS 10.11–12)
  • An administrator account on your Mac (password or Touch ID), which you need to grant permissions
  • A working trackpad or mouse, because the unlock only works with a pointing device
  • A soft, lint-free microfiber cleaning cloth
  • Optional: 70 percent isopropyl alcohol wipes for disinfecting hard, non-porous surfaces
RequirementDetails
DeviceAny MacBook Air, MacBook Pro, iMac, Mac mini, Mac Studio, or Mac Pro
OS versionmacOS 13 or later (check in Apple menu > About This Mac)
CostFree
InternetNeeded once, to download the app

Method 1: Shut Down Your Mac (Safest)

Apple’s own cleaning guidance says to shut down your Mac and unplug the power adapter before cleaning. A Mac that’s off can’t act on stray keypresses, so this is the most reliable option. It’s also the right choice if you’re using anything damp, such as disinfectant wipes.

Step 1: Save Your Work and Shut Down

Click the Apple menu in the top-left corner of the screen, then choose Shut Down. Click Shut Down again in the confirmation dialog.

macOS 27 desktop with the Apple menu open in the top-left of the menu bar, showing About This Mac, System Settings…, App Store, Recent Items, Force Quit, Sleep, Restart…, and the Shut Down… item highlighted

Expected result: The screen goes black and the Mac powers off completely.

Step 2: Unplug and Clean

Unplug the power adapter and any accessories. Then follow Apple’s cleaning guidance:

  • Use a soft, slightly damp, lint-free cloth.
  • Don’t spray liquid directly onto the Mac, and keep moisture out of openings.
  • Don’t use bleach, hydrogen peroxide, or abrasive cleaners.

Warning: Don’t blast compressed air straight into the keys. If a key feels stuck, follow Apple’s keyboard-cleaning steps for MacBook and MacBook Pro, which use the can’s straw held about half an inch from the keyboard and never an inverted can.

Step 3: Power Back On

Once everything is completely dry, press the power button (or Touch ID button) to start up again.

The trade-off: Shutdown is bulletproof, but you have to reopen your apps afterward. For a quick daily wipe, Method 2 is much more convenient.

Why Lock Screen and Sleep Don’t Block Keystrokes

It’s tempting to press Control + Command + Q (Lock Screen) or close the lid and call it done. Neither one actually blocks input:

  • Lock Screen only hides your desktop. The keyboard stays active and types into the password field. Depending on your Mac and settings, some keys such as brightness or volume may still respond, and a string of wrong password attempts can make macOS pause before letting you try again.
  • Sleep turns off the display, but pressing a key or touching the trackpad wakes the Mac right back up. If your Mac is set to require a password only after a delay, the wake can put you straight back into your open apps, where every stray tap counts.
  • Closing a MacBook lid doesn’t help either, because you can’t clean the keyboard with the lid shut.

In short, these are screen states, not input blockers. For cleaning, use Method 1 or Method 2.

Method 2: Step-by-Step Guide to Setting Up KeyboardCleanTool

Step 1: Download KeyboardCleanTool

On your Mac, open Safari and go to folivora.ai/keyboardcleantool. Click the download link for the current version. If you’re on macOS 12 or earlier, download version 7 instead.

KeyboardCleanTool official page on folivora.ai showing the app description and download link

Expected result: A file appears in your Downloads folder. Safari usually unzips it for you automatically.

Step 2: Move the App to Applications

Open Finder and click Downloads in the sidebar. Drag KeyboardCleanTool into the Applications folder.

Expected result: KeyboardCleanTool now appears in Finder > Applications.

Step 3: Open the App for the First Time

Double-click KeyboardCleanTool in Applications. Because it didn’t come from the Mac App Store, macOS asks whether you’re sure you want to open it. Click Open.

If macOS blocks the app instead, go to System Settings > Privacy & Security. Scroll down to the Security section and click Open Anyway next to the KeyboardCleanTool message. Enter your password and click Open to confirm.

System Settings > Privacy & Security main page scrolled to the Security section, showing the area where the Open Anyway button appears for blocked apps

Expected result: The KeyboardCleanTool window opens.

Step 4: Grant Accessibility Permission

macOS treats blocking keystrokes as a sensitive ability, so you have to approve it by hand. When the app prompts you, click the button to open System Settings. You can also go there yourself: System Settings > Privacy & Security > Accessibility.

Find KeyboardCleanTool in the list and turn on its toggle. Enter your password or use Touch ID when asked. If the app isn’t listed, click the + button, choose Applications > KeyboardCleanTool, and click Open.

System Settings > Privacy & Security > Accessibility showing the list of apps with toggle switches, the KeyboardCleanTool toggle, and the + and – buttons below the list

Tip: If you’d like to jump straight to the Accessibility pane, you can paste this into Terminal. It’s optional, and the clicks above do the same thing:

open "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"

Granting permission safely: Only give Accessibility access to apps you downloaded from the developer’s official site. This permission lets an app see and control input, so treat it like a house key. Check this list now and then, and turn off anything you don’t recognize.

Expected result: The toggle next to KeyboardCleanTool shows as on (blue).

Step 5: Quit and Reopen the App

Some macOS versions only apply the new permission after the app restarts. Quit KeyboardCleanTool with Command + Q, then open it again from Applications.

Step 6: Choose Your Lock Options

In the KeyboardCleanTool window, look for the option to also lock the trackpad or mouse. Turn it on if you plan to wipe the trackpad too. Version 8 can also unlock automatically after a timer, and it’s worth setting one as a safety net.

Expected result: Your options are set, and the main start button is ready to click.

Step 7: Start the Lock and Clean

Click the start or lock button. The screen darkens and a timer shows how long the lock has been active.

Test it by pressing a few keys. Nothing should happen. Now grab your cloth and clean.

Expected result: Keys (and the trackpad, if you enabled that option) do nothing, and your Mac stays awake.

Step 8: Unlock When You’re Done

Press and hold the trackpad or mouse button for a few seconds, following the on-screen instructions. You can also just wait for the auto-unlock timer to run out. There’s no keyboard shortcut to unlock, by design.

Expected result: The screen returns to normal and input works again.

Configuration: Trackpad and External Peripherals

Locking the Trackpad

Locking the keyboard doesn’t always lock the trackpad. In KeyboardCleanTool, the trackpad/mouse lock is a separate in-app option, and its default depends on the version. Check it before every session. Other cleaning utilities, including KeyboardCleanTool’s own legacy version 7, lock only the keyboard and leave the trackpad active.

If clicks feel off after cleaning, check System Settings > Trackpad to confirm your Click pressure and Tracking speed haven’t changed.

System Settings > Trackpad panel showing the Click pressure and Tracking speed sliders

External Bluetooth and USB Keyboards and Mice

Don’t assume a software lock covers every external keyboard or mouse. If you’re cleaning an accessory, the simplest move is to take it out of the equation:

  • Apple Magic Keyboard, Magic Trackpad, or Magic Mouse: Slide the power switch to off (on the back edge or underside).
  • USB keyboards and mice: Unplug them, or unplug the USB-C hub they connect through.
  • Other Bluetooth devices: Turn them off with their own power switch.

Warning: On an iMac, Mac mini, or Mac Studio, don’t turn off Bluetooth for the whole Mac if your only mouse or trackpad is wireless. You’d lose the pointer you need to unlock KeyboardCleanTool.

Keeping Kids or Pets From Typing

KeyboardCleanTool works well for short breaks too. Lock the keyboard, and a toddler or cat can mash keys without closing your document. For longer stretches, macOS has better built-in tools:

  • Lock your screen when you walk away. It won’t stop key-mashing, but it protects your open work, and the stray keys just go into the password field.
  • Set up a Guest User. Go to System Settings > Users & Groups, click the Info button next to Guest User, and turn on Allow guests to log in to this computer. Kids get their own sandbox, and everything they do is erased when they log out.
System Settings > Users & Groups panel showing the Guest User entry and its settings for allowing guests to log in
  • Use Screen Time. Go to System Settings > Screen Time to set a Screen Time Schedule (called Downtime before macOS 27) and Content & Privacy Restrictions. This works best on a child’s own user account.
macOS 27 System Settings > Screen Time pane showing the Screen Time Schedule, Time Allowances, and Content & Privacy Restrictions options

Removing Accessibility Permission After Uninstalling

When you delete an app, macOS doesn’t always remove its Accessibility entry. To clean up:

  • Quit KeyboardCleanTool, then drag it from Applications to the Trash.
  • Go to System Settings > Privacy & Security > Accessibility.
  • Select the KeyboardCleanTool entry and click the minus (–) button.
  • Enter your password to confirm.

Expected result: The app no longer appears in the Accessibility list.

Tips and Troubleshooting

The app doesn’t lock anything

Why it happens: Accessibility permission isn’t turned on, or the app hasn’t picked it up yet.

Fix: Turn on the toggle in System Settings > Privacy & Security > Accessibility, then quit and reopen the app. If the toggle is already on, select the entry, remove it with –, and add it again with +.

macOS says the app can’t be opened

Why it happens: Gatekeeper, the Mac’s built-in app checker, flags apps from outside the Mac App Store the first time you open them.

Fix: Go to System Settings > Privacy & Security, scroll to Security, click Open Anyway, and confirm with Open.

I can’t figure out how to unlock

Why it happens: Keyboard unlocking is disabled on purpose.

Fix: Press and hold a trackpad or mouse button for a few seconds, or wait for the auto-unlock timer. If your wireless mouse died mid-session, plug in a USB mouse (through a USB-C to USB-A adapter if needed). As a last resort, press and hold the power button to force a shutdown, but you’ll lose any unsaved changes in open apps.

The trackpad still clicks while I clean

Why it happens: The trackpad lock option is off, or you’re using a keyboard-only tool.

Fix: Turn on the trackpad/mouse lock in KeyboardCleanTool before you start, or shut down instead.

Pressing the power or Touch ID button still does something

Why it happens: The power button is a hardware control, so apps can’t block it.

Fix: Wipe around that key gently, or shut down first. If your keyboard acts strangely afterward, see Apple’s input troubleshooting guide for 2024 and later Mac laptops.

FAQ

Does macOS have a built-in way to lock the keyboard for cleaning? Not that Apple documents. Apple’s cleaning guidance tells you to shut down and unplug, so your options are shutting down or using a third-party app.

Is shutting down really necessary, or can I just lock the screen? Locking the screen doesn’t block keys. For a quick dry wipe, KeyboardCleanTool is enough. For anything damp, shut down first, as Apple’s cleaning guidance says.

Will locking the keyboard also lock the trackpad? Only if you turn on KeyboardCleanTool’s trackpad/mouse option. Check it before each session.

Is KeyboardCleanTool safe? It comes from folivora.ai, an established Mac developer. Download it only from the official site, and remove its Accessibility permission if you stop using it.

Are there alternatives? Yes, other Mac utilities offer a keyboard lock for cleaning, but features vary and some lock only the keyboard. Before relying on one, confirm it’s from a known developer and that it also locks the trackpad if you plan to wipe it.

Wrapping Up

You can now lock your Mac keyboard and trackpad for cleaning without firing off random shortcuts. Honestly, KeyboardCleanTool is the one I’d keep installed. It’s free, it takes seconds, and the trackpad-only unlock is a smart touch for homes with kids or pets. Still, shut down before any wipe involving moisture, because nothing beats a Mac that’s actually off.

StepActionApplies To
1Shut down and unplugDeep or damp cleaning
2Install KeyboardCleanToolmacOS 13 or later
3Grant Accessibility permissionAll app users
4Turn on the trackpad/mouse lockCleaning the trackpad
5Power off external accessoriesBluetooth and USB peripherals
6Remove the permission after uninstallingAnyone deleting the app

Resources