Skip to content

A tiny application that blocks unintended duplicate keypresses on macOS

License

Notifications You must be signed in to change notification settings

johanbaath/keyblock

Repository files navigation

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

MIT

Copyright (c) 2018-present, Johan Bååth AB.

About

A tiny application that blocks unintended duplicate keypresses on macOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published