Skip to content

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.

Why macOS has no built-in input lock

The macOS 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.

Step 1: install Warden

Warden runs on macOS 15.2 or later. Install it with Homebrew:

$brew install --cask ParthJadhav/warden/warden

Or 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. Warden locks all input devices together — you cannot selectively lock only the keyboard or only the trackpad.

Related

Lock your Mac without stopping your work

One-time purchase. 7-day free trial. Requires macOS 15.2 or later.