Max Lin

锁住键盘,留着触控板Lock the keys.
Keep the trackpad.

擦键盘前点一下 Start Cleaning,每个键都不再起作用,连音量、亮度和 ⌘ 也一样。鼠标和触控板照常能用,擦完点 Finish Cleaning,键盘就回来了。Click Start Cleaning and every key stops doing anything, volume, brightness and ⌘ included. Your mouse and trackpad keep working, and Finish Cleaning gives the keyboard back.

下载 DMGDownload the DMG 免费开源(MIT),经 Apple 公证,需要 macOS 13 和 Apple 芯片Free and open source (MIT). Notarized by Apple. macOS 13 or later on Apple silicon.

Lock immediately on launchStart cleaning as soon as the app opens.
Quit after cleaningClose the app when cleaning is finished.

它只拦键盘事件,指针根本不经过它It stops keyboard events. Pointer events never go near it.

点下 Start Cleaning,App 在 macOS 的事件流上挂一个 Quartz 事件拦截(event tap),只订阅按键按下、抬起、修饰键变化和媒体键这几类事件,收到就丢掉。指针移动、点击、滚动不在订阅里,照常走。Start Cleaning puts a Quartz event tap on the macOS event stream. It subscribes only to key down, key up, modifier changes and media keys, and throws each one away. Pointer movement, clicks and scrolling aren't subscribed, so they flow on as usual.

点 Finish CleaningClick Finish Cleaning
拦截立刻撤掉。开着「Quit after cleaning」(默认开)就顺手退出,关掉它可以再擦一轮。The tap comes off at once. With Quit after cleaning on (the default) the app quits too; turn it off to go another round.
点右上角的 ×Click the × in the corner
App 退出,键盘跟着恢复。清洁中 ⌘Q 也是按键,一样被拦下,所以结束要用鼠标。The app quits and the keyboard comes back. ⌘Q is a keystroke too and gets blocked like the rest, so you finish with the mouse.
App 意外崩溃If the app crashes
拦截挂在 App 自己的进程上,进程没了它也就没了,键盘不会一直锁着。The tap lives inside the app's own process. When the process goes, so does the tap; the keyboard can't stay locked.
拦下的键Blocked
普通键、修饰键、功能键,以及亮度、音量和媒体键。Regular, modifier and function keys, plus brightness, volume and media keys.
照常能用Still works
指针移动、点击和滚动。Pointer movement, clicks and scrolling.
两个开关Two switches
打开 App 就直接锁键盘;擦完自动退出。Lock as soon as the app opens; quit when cleaning is done.
不留后台Nothing left behind
没有菜单栏图标、登录项或后台进程,也不联网。No menu bar item, login item or background process, and no networking.
平台Platform
macOS
要求Requires
macOS 13 或更高,Apple 芯片 Mac;需要授予「辅助功能」权限。macOS 13 or later on an Apple silicon Mac; Accessibility permission.
许可证License
MIT

常见问题Questions

为什么需要「辅助功能」权限?Why does it need Accessibility permission?

macOS 只允许获得该权限的 App 拦截键盘事件。OpenKeyboardCleanTool 只用它在清洁期间丢弃按键,不读取、不记录你按了什么。首次使用时在 系统设置 → 隐私与安全性 → 辅助功能 里打开它,回到 App 点「Check Again」。macOS only lets apps with this permission intercept keyboard events. OpenKeyboardCleanTool uses it solely to discard keystrokes while cleaning; it does not read or record what was pressed. On first use, enable it in System Settings → Privacy & Security → Accessibility, then return to the app and click Check Again.

键盘被锁住了,怎么解锁?The keyboard is locked. How do I unlock it?

用鼠标或触控板点窗口里的「Finish Cleaning」,或点右上角的关闭按钮退出 App。App 一退出,键盘就恢复。Click Finish Cleaning with your mouse or trackpad, or click the close button at the top right to quit. As soon as the app quits, the keyboard works again.

打开时会被 Gatekeeper 拦住吗?Will Gatekeeper block it?

不会。发布的 DMG 用 Developer ID 签名并经过 Apple 公证,拖进「应用程序」即可直接打开。No. The released DMG is signed with a Developer ID certificate and notarized by Apple, so it opens normally after you drag it to Applications.

支持 Intel Mac 吗?Does it run on Intel Macs?

发布版只支持 Apple 芯片 Mac。The released build supports Apple silicon Macs only.

怎么卸载?How do I uninstall it?

把 App 从「应用程序」拖到废纸篓,删除 ~/Library/Preferences/dev.openkeyboardcleantool.app.plist(两个开关的设置),再到 系统设置 → 隐私与安全性 → 辅助功能 里移除它。Drag the app from Applications to the Trash, delete ~/Library/Preferences/dev.openkeyboardcleantool.app.plist (the two preferences), and remove it from System Settings → Privacy & Security → Accessibility.

获取帮助Get help

发邮件到Email hi@max1874.com,或在 , or open an issue on GitHub 提 issue。写上设备型号和系统版本,能更快定位问题。. Include your device model and OS version so the problem is easier to find.