How to lock your Mac keyboard, mouse, and trackpad
macOS has no built-in way to disable the keyboard and trackpad without also hiding your screen. Here is how to block every input device while your work stays visible and running.
7-day free trial · $8.99 once · No card to start
Can you lock a Mac keyboard without locking the screen?
Not with macOS alone. The built-in screen lock is all-or-nothing: it hides your desktop behind the login window. That is the right behaviour when you want privacy, and the wrong one when you need to watch a build, a render, or an AI agent finish its work. There is no system preference that disables the keyboard and trackpad while leaving the display on.
Third-party utilities fill that gap by intercepting input events before applications receive them. Warden does this with macOS CGEvent taps, which sit at the event layer rather than inside any single app.
What are the built-in options?
macOS has a few partial ones. None of them blocks the built-in keyboard and trackpad while the screen stays visible.
- Lock Screen (⌃⌘Q or a Hot Corner) stops all input, but hides everything behind the login window.
- Turning off a Bluetooth keyboard or mouse silences that device only. The built-in keyboard and trackpad still work.
- Ignore built-in trackpad (System Settings › Accessibility › Pointer Control) disables the trackpad only while an external mouse or trackpad is connected. The keyboard stays live.
If you need everything blocked and the screen still on, you need an input lock.
Step 1: install Warden
Warden runs on macOS 15.2 or later. Install it with Homebrew:
brew install --cask ParthJadhav/warden/wardenOr download the DMG directly. The 7-day free trial needs no payment details up front.
Step 2: grant Accessibility permission
On first launch macOS prompts for Accessibility permission under System Settings › Privacy & Security. Warden needs it to install the event tap — without that permission macOS will not let any application intercept keyboard and pointer events.
Step 3: lock keyboard, mouse, and trackpad
Press ⌘⇧L or pick Lock from the menu bar icon. Every keyboard, mouse, and trackpad — built-in and connected — stops reaching applications at once, and each connected display gets a lock overlay. Your work keeps running underneath and stays visible.
If you enable sleep prevention, your Mac also stays awake while locked, so a long job will not be suspended halfway through.
Step 4: unlock with Touch ID
Touch ID or your macOS password unlocks the session, and everything is exactly where you left it.
Locking the keyboard for cleaning, kids, and pets
Lock with ⌘⇧L and nothing you wipe, press, or walk across reaches your apps. A cloth over the keys, a toddler at the trackpad, or a cat on the keyboard types nothing, and the screen stays on so you can see that.
For a thorough clean, Apple recommends shutting the Mac down first. An input lock is for the quick wipe-down when you don’t want to stop what’s running.
Can you lock only the keyboard, or only the trackpad?
No. Warden locks every input device together — keyboard, mouse, trackpad, and gestures — so there is no gap a stray hand or paw can get through. If you need one device to keep working, Warden is the wrong tool.