A Karabiner-Elements complex modification that turns your Mac keyboard into a brick on demand — useful when wiping down keys without typing gibberish into whatever app has focus.
- Hold
right_shift+right_commandfor 3 seconds → cleaning mode ON, all keyboard input is swallowed - Hold the same combo again for 3 seconds → cleaning mode OFF
- macOS notification fires on each toggle so you know the state
While active, the following input is dropped:
- All standard
key_codeevents (letters, numbers, modifiers, function keys, arrows, etc.) consumer_key_code(media keys, brightness, volume)apple_vendor_top_case_key_code/apple_vendor_keyboard_key_code(thefnkey and other Apple-specific top-case keys)
Karabiner-Elements cannot intercept these on macOS, so they still work during cleaning mode:
- Trackpad / built-in Magic Trackpad clicks and movement — Apple's internal pointing devices bypass Karabiner's virtual HID driver. If you need pointer events blocked too, lock the screen (
Ctrl + Cmd + Q) before wiping, or use Hammerspoon'seventtapAPI. - Power button, Touch ID — handled by SMC / Secure Enclave below the OS layer.
The toggle combo itself has to survive the catch-all blocker, so it needs to be something you won't fat-finger while cleaning. Two pinky keys held simultaneously for 3 seconds is hard to trigger by accident with a microfiber cloth.
- macOS (tested on Darwin 24.x / Sequoia)
- Karabiner-Elements installed and granted Input Monitoring permission
- Open
~/.config/karabiner/karabiner.json - Paste the rule from
cleaning-mode.jsoninto your profile'scomplex_modifications.rulesarray - Save — Karabiner-Elements reloads automatically
Or import via the Karabiner-Elements UI: Settings → Complex Modifications → Add predefined rule → Import more rules from the Internet, then paste the JSON.
If you want trackpad clicks neutralized too, add a shell_command to the ON-toggle manipulator:
{ "shell_command": "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" }The login screen ignores keyboard and pointer input until you type your password, so the whole machine becomes safe to wipe.