A lightweight macOS utility that temporarily locks your keyboard for cleaning. Prevents accidental key presses while cleaning your MacBook, Magic Keyboard, or any external keyboard connected to your Mac.
- Menu bar tool — Runs from the menu bar (LSUIElement: no Dock icon). Open the popover from the keyboard icon.
- Minimal animated icon — Subtle animation while the keyboard is locked.
- Launch at login — Optional toggle on macOS 13+ (System Settings integration via
SMAppService). - Popover stays open when locked — You can read unlock instructions without the window disappearing.
- Safer while locked — Quit, “Start at login”, and ⌘Q are disabled until you unlock (hold ESC for 3 seconds).
See CHANGELOG.md for full release notes.
- Complete keyboard blocking: Clean your Mac keyboard without triggering unwanted actions
- Multi-display support: Dimmed overlay across all connected screens
- Unlock with ESC: Hold the ESC key for 3 seconds to unlock
- Menu bar UI: Popover controls; right-click the icon for Open / Quit
- Launch at login (macOS 13+): Enable from the popover; older macOS: add the app under System Settings → General → Login Items
- Privacy focused: Zero data collection; runs entirely on your Mac
- Energy efficient: Minimal CPU and memory usage
- Universal binary: Apple Silicon and Intel
- Open Releases
- Download the latest
KeyboardBlocker.app.zip(or attached build for v1.1.0) - Unzip and move KeyboardBlocker.app to Applications
- First launch: Control-click the app → Open to pass Gatekeeper if needed
git clone https://github.com/huseyinaslim/macos-keyboardblocker.git
cd macos-keyboardblocker
swift build -c releaseBinary: .build/release/KeyboardBlocker
For a signed .app bundle with entitlements (e.g. launch at login), use Xcode and enable the Login Items capability to match KeyboardBlocker.entitlements.
- Launch KeyboardBlocker — the icon appears in the menu bar
- Click the icon to open the popover
- Grant Input Monitoring (and Accessibility if prompted) when asked
- Tap Lock Keyboard when you want to clean
- When finished, hold ESC for 3 seconds to unlock
- Right-click the menu bar icon for Open or Quit
While locked, Quit and “Start at login” are intentionally disabled so you don’t exit or change startup settings by accident.
KeyboardBlocker does not collect or transmit data. Input monitoring is used only to intercept keyboard events while the lock is active.
- macOS 11 (Big Sur) or later (launch-at-login toggle requires macOS 13+)
- Apple Silicon or Intel
- Small disk footprint (< 5 MB)
- Issues — bugs and ideas
- Pull requests — improvements
MIT — see LICENSE.
If KeyboardBlocker is useful to you, consider sponsoring on GitHub.
macOS keyboard cleaner, MacBook keyboard lock, keyboard cleaning utility, menu bar utility, launch at login, keyboard blocker, Mac keyboard cleaning tool
