Before the quarantine started, I decided I needed a proper work space at home for my new 16" MBP. A monitor, desk, keyboard, etc. Working from the couch on my laptop just didn't cut it in terms of screen space and ergonomics. So I went out and bought everything including a new Apple Magic Keyboard and Magic Trackpad 2.

After some time, I found the keyboard to be laggy. It was only a minor annoyance when working, but frequently having keypresses queue up and take a few hundred extra milliseconds to appear is beyond annoying... and makes gaming impossible. So I ended up hardwiring the keyboard. But at the same time, that's kind of BS. I bought the 16" MBP and a USB-C monitor because I wanted exactly 2 cords on my desk: Power to the monitor. And USB-C from the monitor to the laptop. After spending several thousand dollars on this setup, it isn't right to need a cord to keep my keyboard plugged in.

Troubleshooting basics

Eventually I contacted Apple. They suggested the usual stuff. Turn the bluetooth devices and bluetooth radio off and on again. Restart the computer. Make sure the bluetooth device batteries are not low. Forget and pair the bluetooth devices again.

You should try those steps first.

When none of that fixed my keyboard lag, Apple Support suggested I reset the SMC. Twice. I offered to try resetting NVRAM, because why not? Those may solve most issues, but they didn't help me. (You can try these troubleshooting steps too. They won't hurt anything.)

Here's what did fix my bluetooth lag (temporarily):

MacOS 11 Big Sur: Hold shift and option on your keyboard, then select the bluetooth menu from the menu bar or control center. Additional debug options and information will appear.
MacOS 11 Big Sur: Hold shift and option on your keyboard, then select the bluetooth menu from the menu bar or control center. Additional debug options and information will appear.
  1. Hold shift and option on your keyboard, then click on the bluetooth system menu. The debug menu should appear (which you wouldn't see without holding shift and option).
  2. "Reset the Bluetooth module"
  3. Repeat steps 1 and 2, but then "factory reset all connected Apple devices"
  4. Connect (or pair) your keyboard, mouse, and other bluetooth devices made by Apple.

Temporary Success

After doing the factory reset on my Magic Keyboard and Magic Touchpad, both devices connect flawlessly to my mac without any lag or delay... for a few days, at least.

  1. Why is this only a temporary fix? Bluetooth uses the 2.4ghz wireless spectrum, which is the same spectrum used by WiFi, wireless home phones, baby monitors, and other devices. Microwaves are known to interfere with 2.4ghz wireless connections. Poorly constructed USB-C cables can also cause interference.
  2. If you bluetooth lag persists, try to reposition things like routers, power sources, other wireless devices, and some types of cables (USB-C cables, especially). If any of your USB-C cables are of questionable quality, consider replacing them with a more expensive cable that is better shielded against interference. Consider if your WiFi router can be reconfigured with a different channel.
  3. I find my Magic Touchpad to more prone to bluetooth lag than my Magic Keyboard. For what it's worth, maybe keep your Magic Touchpad plugged in and then factory reset your Magic Keyboard as needed.

Update 11/16/2020:

I am now running macOS Big Sur (11.0.1) and the above tricks mostly still work. I am updating the screenshot and instructions above. Everything below this is retained for historical reasons, and those still running earlier versions of MacOS and OSX.

Historical Option 2 (Fix a single Apple Bluetooth device. Only works on MacOS 10.15 Catalina and earlier):

  1. Hold shift and option on your keyboard, then click on the bluetooth system menu.
  2. Select your device. Additional debug options and information will appear in a submenu, that wouldn't appear if you didn't hold shift and option when opening the menu.
  3. "Factory reset" the device.
  4. Connect or pair the device again, and repeat this section as needed for other devices.
MacOS 10.15: Hold shift and option when clicking the bluetooth system menu icon to access hidden bluetooth debug options and information.
MacOS 10.15: Hold shift and option when clicking the bluetooth system menu icon to access hidden bluetooth debug options and information.