dotfiles: Key repeat broken in macOS Sierra
Currently your script…
defaults write NSGlobalDomain KeyRepeat -int 0
…does not work in macOS Sierra. I’ve found that if I set things up here they work great:
Maybe they changed the preference file location or something.
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 19
- Comments: 65 (10 by maintainers)
Commits related to this issue
- Self pull (#1) * README: Tweak Git-free install command * bin: Update `subl` symlink to `Sublime Text 3.app` * .osx: Add Spotlight settings Closes #91 and #174. * .bash_profile: Remove ‘a... — committed to nepur/dotfiles by nepur 8 years ago
- .macos: Fix the keyboard repeat rate command Closes #687. — committed to benkroeger/dotfiles by mathiasbynens 8 years ago
- .macos: Fix the keyboard repeat rate command Closes #687. — committed to asbjornu/dotfiles by mathiasbynens 8 years ago
- .macos: Fix the keyboard repeat rate command Closes #687. — committed to dunn/mb-dotfiles by mathiasbynens 8 years ago
- .macos: Set keyboard repeat rate on macOS Sierra Unfortunately it seems the float trick (6b4d9617a059e3ece468e3a9150ea920cadb1fe2) no longer works in macOS Sierra. As @kirbysayshi pointed out, settin... — committed to mathiasbynens/dotfiles by mathiasbynens 8 years ago
- [macos] Set keyboard repeat rates to lowest value See also: https://github.com/mathiasbynens/dotfiles/issues/687 — committed to alrra/dotfiles by alrra 8 years ago
- sierra no longer permits -int 0. Fastest is 2. details https://github.com/mathiasbynens/dotfiles/issues/687 — committed to jodylent/dotfiles by jodylent 8 years ago
- Fixing KeyRepeat before it breaks. ref: https://github.com/mathiasbynens/dotfiles/issues/687 — committed to ideasonpurpose/ansible-playbooks by joemaller 8 years ago
- Keyboard repeat rate fucked up in OSX Sierra by apple See https://github.com/mathiasbynens/dotfiles/issues/687 — committed to AsgerPetersen/dotfiles by AsgerPetersen 8 years ago
- [macos] Set keyboard repeat rates to lowest value See also: mathiasbynens/dotfiles#687 Cherry-picked from https://github.com/alrra/dotfiles/commit/d250bcc106b0caba2f3b52f7b088000e62784232 — committed to wingy3181/dotfiles by wingy3181 8 years ago
- fix key repeat in Sierra (https://github.com/mathiasbynens/dotfiles/issues/687) — committed to f1sherman/dotfiles by f1sherman 8 years ago
- Fix keyrepeat for Sierra See https://github.com/mathiasbynens/dotfiles/issues/687 — committed to MattiSG/DotFiles by MattiSG 8 years ago
- Fix key repeat speedup broken by OSX Sierra (https://github.com/mathiasbynens/dotfiles/issues/687) — committed to 0xdevalias/dotfiles by 0xdevalias 8 years ago
- Doc key repeat on macOS Sierra Based on https://github.com/mathiasbynens/dotfiles/issues/687. — committed to henrik/dotfiles by henrik 8 years ago
- found answer at https://github.com/mathiasbynens/dotfiles/issues/687 — committed to jeffrey-l-turner/dotfiles by jeffrey-l-turner 8 years ago
I have come to this thread looking for a solution to my big issue with the macos Sierra update I’ve recently done, to find a dismal scene. It appears Apple has altered the scaling factors of keyboard repeat rate and wait-times, in a way that has implications for power users everywhere: If you rely on your keyboard as a principle means of interfacing with your computer, your system will now feel slower, no matter what you do.
Just in case anyone at Apple GIAF’s, this nonsense with the key repeat rate has the (intended/un-?) impact of making Apple computers feel slower, for those of us who use keyboard-based applications (apparently there are still a few…) For example, I feel that through todays usage of vim, as opposed to yesterdays pre-Sierra update, my computer is about 3x slower than it was. In actuality, it is not - but it certainly is not sending keys to my apps as fast as it used to, so my apps spend a lot more time just sitting around … waiting for keypress.
It really seems like a systematic failure on Apple’s part to not understand this. I guess in the leap for features (sticky-/hot-keys are a feature now?) and the desire to push Siri everywhere, Apple is preparing us to have the courage required to … get rid of the keyboard, too?
@mathiasbynens
defaults write NSGlobalDomain KeyRepeat -int 1
is the best I can do on macOS Sierra. The float just doesn’t work.I found that locking and unlocking my macbook was enough to apply the changes.
Seems as fast as before for me once I locked and unlocked my computer.
In Sierra you can unplug and replug your external keyboard in for the new values to take effect, no reboot required.
I’m running macOS Sierra 10.12.3, and I concur with @lucascaton. The solution to get the fastest keypress speeds all around is to run the following in your terminal (you can copy-paste the below directly, but note it will restart your computer):
When I attempted lower
int
values for either KeyRepeat or InitialKeyRepeat, I kept running into issues where my Mac Pro’s 4k display literally wouldn’t work at all and/or I had to physically reboot my comp (sidenote: potentially an odd/interesting bug? how/why would keypress settings affect display function?)For me:
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
makes it blazing fast. Even a bit too much, maybe.
@kvpb Yeah, using
float
seems to work (as in, fast keyboard repeat is enabled by it after a reboot):For posterities sake, the following are the macOS 10.12.1 step values for the keyRepeat and InitialKeyRepeat when you set them using the GUI. Lower values are faster.
keyRepeat: 120, 90, 60, 30, 12, 6, 2 InitialKeyRepeat: 120, 94, 68, 35, 25, 15
@anhkind @knpwrs @danemacmillan @kdeldycke If you want to close to
0
try this:defaults write NSGlobalDomain KeyRepeat -int 1
It is as close as you can get on macOS Sierra.
I’ve played with that a bit. I think
0
is no longer allowed as a value, but you could use1
,2
etc. It makes it awfully fast then though. So they might have changed the scale. If you set it to the fastest Key Repeat and shortest initial delay and then read the values on the command line you get2
and15
.@jakeonrails Thanks for that! Worked like a charm on a Mac Pro.
Here’s what I ended up with to correct the problem, using your suggestion.
Same here. I just ugpraded to Sierra and I had to use… the GUI. And even then key repeat wasn’t as fast as it was in El Capitan.
@jdsimcoe Could you do this please?
defaults read > a
defaults read > b
diff a b
here.Logging in and out is enough, don’t need a full restart.
Just have in mind that you need to restart to apply the changes.
Finally found a solution! 🎉
Then, close the app and re-open it.
Hey everybody.
I just got off the phone with Apple Support about this issue. Rubber ducking the problem with a very helpful agent named Zach, I resolved this problem for my computer on OS X Sierra.
The trick was:
defaults write -g KeyRepeat -int 1
followed by a reboot.
Does that fix it for anyone else? I think the reboot step is critical.
@seclorum Apple stopped supporting developers like us aeons ago. Look at Swift Playgrounds on the App store.
In case you guys found default ./.macos setting is too fast. Here is good setting:
FOUND THE SOLUTION
After being desperate myself, I tried out every single solution which was posted here, but nothing helped. Afterwards, I made a single last try:
Deactivate “PressAndHoldEnabled” in the GUI of System-Settings>“Input-Help” (then choose keyboard, and uncheck the checkbox at the bottom)
I also used
$ defaults read -g InitialKeyRepeat 15 $ defaults read -g KeyRepeat 1
Those 2 adjustments only worked after disabling the checkbox in my first step.
This seems to work for me sort of as fast as in El Capitan:
Can’t make it go any faster than this unfortunately.
To be clear:
defaults
(or at least do not update if the value is outside a particular range). Previously, setting keyrepeat 0 and initialkeyrepeat 10 would min/max the sliders.1
is the best we can do for now.Leaving an update here. Using macOS Sierra 10.12.5 and it seems like
defaults write -g KeyRepeat -int 0
+ logout + login now works, albeit too fast.The scales have changed drastically, as @hkdobrev has previously stated. I’ve documented this behavior here:
Take note that while the GIF is indeed skipping frames, it really does skip some frames until I stop holding the repeating key. It’s that fast. The terminal frame skips seem to happen, but they’re more evident in my older MacBook, which means this is probably just dependent on how much text the terminal can handle given the limited resources of the laptop.
This behavior “works” on both my 11-inch Mac Book Air (2014) and my 13-inch Mac Book Air (2017). I’ve since set it to
1
, but it2
can be comfortable as well since the new1
might be a little bit too fast for some people.@lucascaton What makes you say that? It’s not commented out: https://github.com/mathiasbynens/dotfiles/blob/d6ca39a907123c0a7f874c500ba16cabb3156a63/.macos#L181-L186
Doesn’t seem anyone mentioned this yet, but when doing
defaults write -g KeyRepeat -int N
andN
is0
or1
, then the slider in System Preferences shows up in the middle, but the actual tested key repeat is indeed blazing fast. And I got that working after just a Log Out, which is faster than a full reboot, so if you are like me and wanted to test different values out, you don’t have to wait for a full reboot.@lobster-jack Thanks! I haven’t been able to confirm this myself yet (since everything is already working on my end), but here’s some more info:
For those running macOS in English, that’s System Preferences → Accessibility.
This is the checkbox that says “Enable Slow Keys”.
I can’t find any command that works for macOS Sierra. Something must have changed …
On macOS build 16a294a, after setting values through the prefs panel (and verifying that it works in the terminal), these are the values I see:
It works for me:
sudo defaults write NSGlobalDomain KeyRepeat -float 0.000000000001
W/o sudo it does not work
…and suddenly - the error disappeared. I think I interpreted an answer in this thread wrong and made an incorrect assumption. Thanks, and sorry 😃
Good but I hate rebooting.
Guys it works pretty awesome and it will be much to fast (at least for me (; ), I was not even able to type. How I got it working (also in iTerm), the min. value for
KeyRepeat
seems to be 1 and forInitialKeyRepeat
15 (for fast repeat) viaSystem Preferences
, by using the following values:after it I closed all applications and explicit called the “Logout”. Maybe you should also try to keep the System Preferences closed or at least not pointing to the keyboard configuration.
PS: I guess that float values are also working since the KeyRepeat value could be set on previous Mac OS X versions to float value.
@knpwrs I’m experiencing the same thing. They key repeat set from CLI appears to have no affect. Furthermore, after a reboot, the settings set from the GUI are lost, which means I need to set the preferences every time.