How can I increase the key repeat rate beyond the OS's limit?

Viewed 44605

I have a bad habit of using the cursor keys of my keyboard to navigate source code. It's something I've done for 15 years and this of course means that my navigating speed is limited by the speed of the keyboard. On both Vista and OS X (I dual boot a MacBook), I have my key repeat rate turned all the way up. But in Visual Studio, and other apps, the rate is still much slower than I would prefer.

How can I make the key repeat rate faster in Visual Studio and other text editors?

15 Answers

On Mac OS X, open the Global Preferences plist

open ~/Library/Preferences/.GlobalPreferences.plist

Then change the KeyRepeat field. Smaller numbers will speed up your cursor rate. The settings dialog will only set it to a minimum of 2, so if you go to 0 or 1, you'll get a faster cursor.

I had to reboot for this to take effect.

For Windows, open regedit.exe and navigate to HKEY_CURRENT_USER\Control Panel\Keyboard. Change KeyboardSpeed to your liking.

Visual Assist has an option to double your effective key movements in Visual Studio which I use all the time.

I'm using KeyboardKing on my PC. It's freeware and it can increase the repeat rate up to 200 which is quite enough. I recommend to set the process priority to High for even smoother moves and less "repeat locks" which happen sometime and are very annoying. With high priority, it works perfectly.

No one understands why we navigate by arrows. It's funny.

Keyboard preferences window

As mentioned by the hyperlogic, on Mac OS X, internally, there are two parameters dealing with the keyboard speed: KeyRepeat and InitialKeyRepeat. In the System Preferences they are mapped to the Key Repeat Rate and the Delay Until Repeat sliders. The slider ranges and the associated internal parameter values (in parenthesis) are show below. They seem to be multipliers of the 15 ms keyboard sampling interval.

Key Repeat Rate (KeyRepeat)                 Delay Until Repeat (InitialKeyRepeat)
|--------------------------------|          |----------------------|-----------------|
slow (120)                      fast (2)    off (30000)            long (120)        short (25)
0.5 char/s                      33 char/s       

Fortunately, these parameters can be set beyond the predefined limits directly in the ~/Library/Preferences/.GlobalPreferences.plist file. I found the following values most convenient for myself:

KeyRepeat = 1         --> 1/(1*15 ms) = 66.7 char/s
InitialKeyRepeat = 15 --> 15*15 ms = 225 ms

Note that in the latest Mac OS X revisions the sliders are named slightly differently.

I don't know how to accelerate beyond the limit, but I know how to skip further in a single press. My knowledge is only in Windows, as I have no Mac to do this in. Ctrl + Arrow skips a word, and depending on the editor it may just skip to the next section of whitespace. You can also use Ctrl + Shift + Arrow to select a word in any direction.

I do like to work on the keyboard alone. Why? Because when you use the mouse you have to grab it. A time loss.

On the other hand sometimes it seems that every application has its own keyboard type-rates built in. Not to speak from BIOS-properties or OS-settings. So I gathered shortkeys which can be pretty fast (i.e. you are faster typing Ctrl + right(arrow)-right-right than keeping your finger on the right(arrow) key :).

Here are some keyboard shortcuts I find most valuable (it works on Windows; I am not sure about OS X):

ctrl-right: Go to the end of the previous/the next word (stated before)
ctrl-left:  Go to the beginning of the previous/the word before (stated before)
ctrl-up:    Go to the beginning of this paragraph
            (or to the next paragraph over this)
ctrl-down:  Go to the end of this paragraph
            (or to the next paragraph after this)
ctrl-pos1:  Go to the beginning of the file
ctrl-end:   Go to the end of the file

All these may be combined with the shift-key, so that the text is selected while doing so. Now let's go for more weird stuff:

alt-esc:     Get the actual application into the background
ctrl-esc:    This is like pressing the "start-button" in Windows: You can
             navigate with arrow keys or shortcuts to start programs from here
ctrl-l:      While using Firefox this accesses the URL-entry-field to simply
             type URLs (does not work on Stack Overflow :)
ctrl-tab,
ctrl-pageup
ctrl-pagedwn Navigate through tabs (even in your development environment)

So these are the most used shortcuts I need while programming.

On Mac, it's option-arrow to skip a word and +Shift+Arrow to select. +Arrow skips to the end or beginning of a line or the end or beginning of a document. There are also the page up, page down, home and end keys ;) Holding shift selects with those too.

Seems that you can't do this easily on Windows 7.

When you press and hold the button, the speed is controlled by Windows registry key : HCU->Control Panel->Keyboard->Keyboard Delay.

By setting this param to 0 you get maximum repeat rate. The drama is that you can't go below 0 if the repeat speed is still slow for you. 0-delay means that repeat delay is 250ms. But, 250ms delay is still SLOW as hell. See this : http://technet.microsoft.com/en-us/library/cc978658.aspx

You still can go to Accesibility, but you should know that those options are to help disabled people to use their keyboard, not give help for fast-typing geeks. They WON'T help. Use Linux, they tell you.

I bieleve the solution for Windows lies in hardware control. Look for special drivers for your keyboards or try to tweak existing ones.

Well, it might be obvious, but:

  • For horizontal navigation, Home (line start), End (line end), Ctrl-Left (word left), Ctrl-Right (word right) work in all editors I know

  • For vertical navigation, Page Up, Page Down, Ctrl-Home (text start), Ctrl-End (text end) do too

Also (on a side note), I would like to force my Backspace and Delete keys to non-repeat, so that the only way to delete (or replace) text would be to first mark it, then delete it (or type the replacement text).

Don't navigate character-by-character.

In Vim (see ViEmu for Visual Studio):

  • bw -- prev/next word
  • () -- prev/next sentence (full stop-delimited text)
  • {} -- prev/next paragraph (blank-line delimited sections of text)
  • /? -- move the cursor to the prev/next occurence the text found (w/ set incsearch)

Moreover, each of the movements takes a number as prefix that lets you specify how many times to repeat the command, e.g.:

  • 20j -- jump 20 lines down
  • 3} -- three paragraphs down
  • 4w -- move 4 words forward
  • 40G -- move to (absolute) line number 40

There are most likely equivalent ways to navigate through text in your editor. If not, you should consider switching to a better one.

Related