A small macOS command-line tool that locks your keyboard (and your trackpad/mouse) until you press two "activator" keys together again. It's useful for cleaning your keyboard, keeping kids or pets from mashing keys, or just temporarily disabling input.
On launch, keypause asks you to press two keys to use as the activator
combo, and whether it should also lock the trackpad/mouse. Once running, all
keyboard (and optionally pointer) input is swallowed until you press both
activator keys together again, which unlocks input.
- macOS 11 (Big Sur) or later
- Accessibility permissions granted to the built binary (needed to install the event taps)
brew install elijahfriedman/tap/keypause--check-permissions— checks whether Accessibility permission is granted and exits:0if granted,1if not. Prints a line containingAccessibility permission: grantedorAccessibility permission: not granted. Installs no event taps and reads no input, so it's safe to run non-interactively (e.g. in a Homebrew formula'stest doblock, since a fresh CI machine won't have granted the permission and this exercises the real binary without requiring keypresses).--keys=KEY1+KEY2— sets the activator combo from the command line instead of the interactive prompt, e.g.--keys=leftcommand+leftshift. See docs/KEYS.md for accepted key names.--lock-mouse— also locks the trackpad/mouse while locked, instead of the interactive prompt.--toggle-config— toggles whether the saved config file is used, and exits. Installs no event taps and reads no input.--version— prints the version and exits0.--help— prints usage and exits0.
Resolved activator keys and mouse-lock preference are saved to
~/.config/keypause/config and reused on future runs, so you don't need to
pass --keys/--lock-mouse (or answer the interactive prompts) every time.
Command-line flags always take precedence and update the saved config. Run
keypause --toggle-config to disable (or re-enable) using the saved config
without deleting it — while disabled, keypause always falls back to
command-line flags or the interactive prompts, and won't overwrite the saved
file.
Open keypause.xcodeproj in Xcode and build, or build from the command line:
xcodebuild -project keypause.xcodeproj -scheme keypause -configuration Release