Keyblock
A tiny application that blocks unintended duplicate keypresses on macOS
Install / Use
/learn @johanbaath/KeyblockREADME
keyblock
A tiny application that blocks unintended duplicate keypresses caused by defect first- and second-generation butterfly keyboards from Apple.
It works by intercepting and blocking certain keyboard events depending on how long ago a key-down event was triggered.
The application is designed to run in the background at all times. It uses a minimal amount of CPU and RAM.
Why?
I don't want to pay ~€300-400 for a replacement keyboard. The issue can easily develop again until Apple releases a new generation of keyboards for the MacBook series, or adjusts the design of the current model.
The issue is widespread and is described in more detail here, here, here, here, here and here.
Installing
$ sudo ./install.sh
This will build and install keyblock as a launch daemon.
Uninstalling
$ sudo ./uninstall.sh
This will remove all installed files, including configuration files, and unload the launch daemon.
Configuration
Copy settings.sample.json to settings.json and place it in the /usr/local/etc/keyblock directory after you run the install script described above.
The configuration file accepts an array of objects under the property keys. Each object has the following properties:
-
keyCode- The key code to watch in decimal format.
-
delay- The time in milliseconds that has to elapse between key events. If the key event is triggered within the delay, the event will be blocked.
In the sample configuration, the application will block the n key (on my keyboard, your key code might differ) if the key is pressed twice or more within 100 ms.
Finding key codes
I recommend using this handy application to find the correct key codes.
License
Copyright (c) 2018-present, Johan Bååth AB.
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
