Question: On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.

Is there any way to fix that ?

Answer: 
Just as an FYI, I found an alternative solution [in another question](https://apple.stackexchange.com/a/262187/315835):

1. Go to *System Preferences* -> *Accessibility* -> *Keyboard*
2. Check *Enable Slow Keys*
3. Click *Options*
4. Drag the *Acceptance Delay* slider all the way to the left
5. Press *OK*

**However**, this fix introduces other problems, including:

* If you hold down a key to repeat it (such as `delete`), then the repeat delay is extremely slow
* Some keyboard shortcuts like `Crtl`+`Shift`+`Tab` may no longer work

Tested on macOS 10.14.4 and 10.15.7
1. Download and install the following software
	* Karabiner
	* Hammerspoon
2. Use Karabiner maps CapsLock key to F19.
3. Edit `init.lua` under the path `~/.hammerspoon`, paste the code below.

```lua
pressedF19 = function()
    hs.hid.capslock.toggle()
end

hs.hotkey.bind({}, 'F19', pressedF19, nil)

```

Then reload the hammerspoon config for changes to take effect.

See my blog here <http://hellohtml5.com/2019/04/25/best-way-to-disable-capslock-delay-on-mac/>