Remove Caps Delay MBP15 Touchbar Late 2016

firmwarekeyboardterminal

I've noticed very strange behavior of the internal keyboard's caps lock on a MBP15 Touchbar MacBookPro13,3 10.12.4 Sierra.

Ever since, I've remapped caps to ctrl. Now, with the new MBP when I press caps + a key repeatedly, or hold it, some strokes are omitted.

That results in very annoying behavior, for example in Terminal when I press caps-c, sometimes ^C and sometimes c is sent to the terminal.

I've tried the following to pin down the problem but couldn't find a solution

  • defaults write -g ApplePressAndHoldEnabled -bool false
  • defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
  • defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
  • disabling Accessibility tools like BTT or Spectacle
  • no .inputrc
  • rebooting to login screen and pressing caps multiple times also seems to omit some key presses
  • remapping caps to command and trying to open multiple tabs in Chrome with caps-t results in some tabs getting creating but also ttttt being entered into the URL bar
  • enabling Accessibility > Keyboard > Slow Keys in Preferences and setting a short delay decreases the likelihood of the problem a bit but it is still there and the setting also makes me type much slower
  • external keyboard caps remapping works and is without delay, so it seems to be a MBP15 2016 keyboard firmware issue

It seems Apple previously regressed on the caps delay 'feature' in 2014. Is this another regression in 2016?

Anyone knows a solution or can reproduce?

Best Answer

I was able to solve the problem. It seemed that the MBP was in some kind of HID configuration state which enabled the delay. To get the MBP out of the state, I reimplemented the 2015 Linux solution under macOS / IOKit. Sending 09 00 00 00 to the Keyboard, and then going through the remapping in Preferences again, removed the delay.