20 December 2018

Removing the pesky Caps Lock delay on macOS Mojave

You may have noticed that in order to engage Caps Lock on your Apple computer, you have to hold the button down for about 100 milliseconds; shorter keypresses are just ignored.

Personally, I type fast, and my keypresses are all equally brief, so in my case this "feature" causes Caps Lock mode to almost never get activated as expected, causing frustration.

Apple does not seem to provide any means to configure this delay.

Third-party solutions do exist, and I've been using Karabiner-Elements for a long time, which had a handy option to completely remove the said delay - until version 12, that is.

Here is what the author has to say about Karabiner-Elements no longer offering the option:

Since v12.0.0, Karabiner-Elements's virtual keyboard acts like the real hardware keyboard. Thus, macOS ignores the short press on caps lock.

However, Karabiner-Elements still offers a way: it can hold the Caps Lock button for you, so you don't have to :) That is, a brief physical keypress will turn into a longer "virtual" one automagically.

Here is how.

First, install Karabiner-Elements and upgrade it to at least version 12.1.57 (which is beta as of the time of writing). In order to upgrade to a beta version, run Karabiner-Elements, open its Preferences screen and use the "Check for beta updates" option:

Now we need to create a "Complex Modifications" rule that would map the caps_lock key to itself, but being artificially held down for 100 milliseconds.

Create a text file with content posted below, and place it somewhere locally on your computer - for example, /tmp/remove_caps_lock_delay.json
Here is the text file content:

Now, open the following link in your Safari browser (make sure to replace /tmp/remove_caps_lock_delay.json if you have the file at another location):

You will be prompted to import the rule into Karabiner-Elements.

After a successful import, open Karabiner-Elements Preferences screen again, visit the "Complex Modifications" tab, press the "Add rule" button, and select "Enable" to the right of our newly imported "Remove Caps Lock delay" rule:

To make the feature stable, set all timeouts to 100 milliseconds at the "Complex Modifications" -> "Parameters" screen:

That is all there is to it. No matter how briefly you press Caps Lock, Karabiner will "hold" it down long enough for macOS to recognize the keypress.

No comments:

Post a Comment