Sunday, 14 August 2011

MacOS: Fast key repeat

I do a lot of coding in VIM, which involves scrolling the cursor around with the keyboard. One thing that bothered me quite a bit when switching to a Mac was the slow key repeat rate in Lion, which makes using keyboard-based editors very cumbersome. Key repeat rate can be configured from the menu System Preferences / Keyboard, but I found that even the fastest setting was still too slow for my taste.

Changing key repeat speed from the command line

I’ve seen the following solution proposed on Mac world, but for some reason it didn’t work for me, but you might want to give it a try:

Everybody knows that you can get a pretty fast keyboard repeat rate by changing a slider on the Keyboard tab of the Keyboard & Mouse System Preferences panel. But you can make it even faster! In Terminal, run this command:

  defaults write NSGlobalDomain KeyRepeat -int 0

You can increase the last value to any integer to slow down the key repeat. A value of 2 corresponds to the maximum speed that can be obtained from the System Preferences.

Setting a flexible key repeat speed with keyremap4macbook

What worked for me was setting a flexible key repeat via the keyremap4macbook application. After installing, you can flexibly set key repeat speed to as fast or slow as you like, as shown below.

I’ve had some trouble getting this to work with Lion’s press & hold menu (the one that allows you to choose variations of a letter, such as umlauts). I recommend switching off press & hold and reenabling key repeat by entering the following from terminal.

    defaults write -g ApplePressAndHoldEnabled -bool false

You’ll need to log out and in again for this setting to take effect.

No comments:

Post a Comment