Skip to content

hoichann/KeyboardLocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Key察

A lightweight macOS menu bar app to temporarily disable keyboard input.

「Key察」= Key + 警察 = キーボードの警察官

Menu Bar Size License

Why?

  • Clean your keyboard without accidental input
  • Prevent cats from typing
  • Focus mode during presentations
  • No external dependencies - just pure Swift
  • Open source - you can verify it's not a keylogger

Features

  • 🔒 One-click keyboard lock/unlock from menu bar
  • 🔓 Auto-unlock on wake from sleep
  • 📢 Notification on state change
  • 💾 Only ~29MB memory usage
  • 📦 96KB app size

Installation

Download

Download the latest release from Releases.

Build from source

git clone https://github.com/Perriermax/KeyboardLocker.git
cd KeyboardLocker
./build.sh
cp -r Key察.app /Applications/

Grant Permission

On first launch, you'll need to grant Accessibility permission:

  1. Open System Settings
  2. Go to Privacy & SecurityAccessibility
  3. Add and enable Key察

Usage

  1. Click the lock icon in the menu bar
  2. Select "Lock Keyboard" to disable input
  3. Click again and select "Unlock Keyboard" to re-enable

The keyboard automatically unlocks when waking from sleep.

Requirements

  • macOS 12.0 (Monterey) or later
  • Accessibility permission

How It Works

Key察 uses CGEvent.tapCreate to intercept keyboard events at the system level. When locked, all keyboard events are discarded before reaching any application.

This is the same API that accessibility tools and keyboard customization apps use. It requires explicit user permission for security reasons.

License

MIT License - see LICENSE

Disclaimer

This app is provided "as is" without warranty of any kind. Use at your own risk. The author is not responsible for any damages caused by using this app.

Author

hoichan

About

A lightweight macOS menu bar app to temporarily disable keyboard input.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors