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

前端 未结 15 1792
攒了一身酷
攒了一身酷 2021-01-29 21:16

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

15条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-29 21:49

    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.

提交回复
热议问题