Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐈 CatLock

Your cat sits on the keyboard. CatLock notices, and locks it.

A macOS menu bar app that tells a paw apart from fingers and blocks the keyboard before your cat sends the email, closes the tab, or renames the file.


The problem

Cats love keyboards. A cat settling onto one fires off dozens of keystrokes and shortcuts — quitting apps, mangling documents, triggering things you then have to undo. You usually notice a second or two after the damage.

CatLock watches every keystroke, recognises the pattern of a cat, and suppresses keyboard input system-wide until you shoo them off and click Unlock.

How it decides it's a cat

Two signals, both of them things a paw does and fingers do not:

Signal What it catches
Several keys at once A paw or a settling cat presses everything under it in one go. Configurable: 3, 4 or 5 keys landing within 350 ms of each other.
A key stuck on repeat A cat leans on one key until the screen fills with aaaaaaaa. Configurable repeat count, ~1–4 seconds.

Deliberately not used: raw typing speed and key adjacency. Both produced false positives on fast typists, and speed alone is not evidence of a cat.

What is explicitly safe:

  • Typing fast — speed is never a trigger
  • Rolling overlap between two keys, the way real typing works
  • ⌘⇧-heavy shortcuts, and holding Shift for a whole sentence
  • Leaning on delete, space, return or the arrows — those are exempt from the repeat rule
  • Holding WASD in a game — keys held apart in time never add up to a paw, and you can exclude specific apps entirely

Every one of these is covered by a test.

Getting out

The mouse is never blocked — it's the escape hatch.

  • Click Unlock on the overlay
  • Or hold Esc (or Delete / Return) for 2 seconds — configurable
  • Or let it lift itself after a few seconds of no typing, if you enable that

After an unlock, CatLock waits until every key is physically released before it starts watching again, so a cat that hasn't moved doesn't cause a lock/unlock loop.

Features

  • Menu bar app — no dock icon, no window in the way
  • Settings for everything: exact thresholds, unlock key and hold time, overlay style, sounds, notifications
  • Overlay you choose — full-screen dim or a small banner, with one of six cat emoji or a photo of your own cat
  • History & stats — every lock with its time, reason and the app you were in, plus counts for today and this week
  • Quiet hours — only watch during set hours and days
  • Per-app exclusions — for games where holding several keys is the point
  • English and العربية, with full right-to-left layout
CatLock Settings, General tab Appearance tab with mascot picker and live overlay preview Detection tab in Arabic, laid out right to left

Install

Download CatLock — open the disk image, drag CatLock to Applications, and launch it. The app is signed and notarised by Apple, so it opens without any warning.

On first launch it asks for Accessibility permission. macOS will not grant this on its own: open System Settings → Privacy & Security → Accessibility and switch CatLock on. Blocking keystrokes is impossible without it.

Requirements

  • macOS 15.6 or later
  • Accessibility permission (System Settings → Privacy & Security → Accessibility). Blocking keystrokes requires a system event tap, and macOS only grants those to trusted apps. CatLock asks for this on first launch and cannot work without it.

Building

git clone https://github.com/BandarHL/CatLock.git
cd CatLock
xcodebuild -project CatLock.xcodeproj -scheme CatLock -destination 'platform=macOS' build

Or open CatLock.xcodeproj in Xcode and hit Run. No dependencies, no package manager.

To cut a release — a universal, signed, notarised and stapled DMG — run ./scripts/release.sh. It needs a Developer ID Application certificate and notarisation credentials stored as CatLock-notary; the script explains both if either is missing.

Run the tests with:

xcodebuild -project CatLock.xcodeproj -scheme CatLock -destination 'platform=macOS' test

Privacy

CatLock reads keystrokes because that is the only way to recognise a cat pressing them. It never stores what you type — the detector keeps only key codes and timestamps in memory, and forgets them as soon as they age out.

The history file records that a lock happened, when, why, and which app was in front. Nothing else. It lives at ~/Library/Application Support/CatLock/history.json, and there is a Clear History button. There is no network code in the app.

Known limitations

  • Not sandboxed, so not on the Mac App Store. Event taps and Accessibility are incompatible with the App Sandbox. Distribute as a signed and notarised app.
  • Blind inside Secure Input fields — password prompts, sudo in Terminal. macOS hides keystrokes from every event tap there, by design. Your cat can't do much damage in a password field anyway.
  • Keystrokes typed before detection are not undone. CatLock locks within one or two keystrokes, but it will not press ⌘Z for you — too risky.
  • A cat that walks across the keyboard one key at a time, never pressing several at once and never resting long enough to repeat, can slip through. Raise the sensitivity if that's your cat.

About

Your cat sits on the keyboard. CatLock notices, and locks it.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages