Skip to content

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keypause

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.

How it works

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.

Requirements

  • macOS 11 (Big Sur) or later
  • Accessibility permissions granted to the built binary (needed to install the event taps)

Installation

brew install elijahfriedman/tap/keypause

Command-line options

  • --check-permissions — checks whether Accessibility permission is granted and exits: 0 if granted, 1 if not. Prints a line containing Accessibility permission: granted or Accessibility 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's test do block, 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 exits 0.
  • --help — prints usage and exits 0.

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.

Building

Open keypause.xcodeproj in Xcode and build, or build from the command line:

xcodebuild -project keypause.xcodeproj -scheme keypause -configuration Release

About

A lightweight macOS terminal app that pauses the keyboard/cursor

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages