windows 如何将密钥重复率提高到超出操作系统的限制?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/171326/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I increase the key repeat rate beyond the OS's limit?
提问by Frank Krueger
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.
我有使用键盘的光标键来导航源代码的坏习惯。这是我做了 15 年的事情,这当然意味着我的导航速度受到键盘速度的限制。在 Vista 和 OS X(我双启动 MacBook)上,我的键重复率一直调高。但是在 Visual Studio 和其他应用程序中,速度仍然比我希望的要慢得多。
How can I make the key repeat rate faster in Visual Studio and other text editors?
如何在 Visual Studio 和其他文本编辑器中提高密钥重复率?
采纳答案by hyperlogic
On Mac OS X, open the Global Preferences plist
在 Mac OS X 上,打开 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.
然后更改 KeyRepeat 字段。较小的数字会加快您的光标速度。设置对话框只会将其设置为最小值 2,因此如果您选择 0 或 1,您将获得更快的光标。
I had to reboot for this to take effect.
我必须重新启动才能生效。
回答by Mud
In Windows you can set this with a system call (SystemParametersInfo(SPI_SETFILTERKEYS,...)
).
在 Windows 中,您可以使用系统调用 ( SystemParametersInfo(SPI_SETFILTERKEYS,...)
) 进行设置。
I wrote a utility for myself: keyrate <delay> <repeat>
.
我为自己写了一个实用程序:keyrate <delay> <repeat>
.
Full source in case that link goes away:
万一链接消失的完整来源:
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
BOOL parseDword(const char* in, DWORD* out)
{
char* end;
long result = strtol(in, &end, 10);
BOOL success = (errno == 0 && end != in);
if (success)
{
*out = result;
}
return success;
}
int main(int argc, char* argv[])
{
FILTERKEYS keys = { sizeof(FILTERKEYS) };
if (argc == 1)
{
puts ("No parameters given: disabling.");
}
else if (argc != 3)
{
puts ("Usage: keyrate <delay ms> <repeat ms>\nCall with no parameters to disable.");
return 0;
}
else if (parseDword(argv[1], &keys.iDelayMSec)
&& parseDword(argv[2], &keys.iRepeatMSec))
{
printf("Setting keyrate: delay: %d, rate: %d\n", (int) keys.iDelayMSec, (int) keys.iRepeatMSec);
keys.dwFlags = FKF_FILTERKEYSON|FKF_AVAILABLE;
}
if (!SystemParametersInfo (SPI_SETFILTERKEYS, 0, (LPVOID) &keys, 0))
{
fprintf (stderr, "System call failed.\nUnable to set keyrate.");
}
return 0;
}
回答by chuckf
Many times I want to center a function in my window. Scrolling is the only way. Also, Ctrl-left/right can still be slow in code where there are a lot of non-word characters. I use keyboardking also. It has a couple of isssues for me though. One, it sometimes uses the default speed instead of the actual value I set. The other is sometimes it ignores the initial delay. I still find it very useful though. They said 4 years ago they would release the source in 6 months... :(
很多时候我想在我的窗口中居中一个函数。滚动是唯一的方法。此外,在有很多非单词字符的代码中,Ctrl-left/right 仍然会很慢。我也用键盘。不过,它对我来说有几个问题。一,它有时使用默认速度而不是我设置的实际值。另一个是有时它会忽略初始延迟。不过我仍然觉得它非常有用。他们在 4 年前说他们将在 6 个月内发布消息来源...... :(
Ok, on the suggestion of someone that modified HCU\...\Keyboard Response, this works well for me.
好的,根据修改 HCU\...\Keyboard Response 的人的建议,这对我很有效。
[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]
"AutoRepeatDelay"="250"
"AutoRepeatRate"="13"
"BounceTime"="0"
"DelayBeforeAcceptance"="0"
"Flags"="59"
Windows standard AutoRepeat delay. 13 ms (77 char/sec) repeat rate. flags turns on FilterKeys? These values are read at login. Remember to log out and back in for this to take effect.
Windows 标准自动重复延迟。13 毫秒(77 个字符/秒)重复率。标志打开筛选键?这些值在登录时读取。请记住注销并重新登录以使其生效。
回答by Jake
For Windows, open regedit.exe and navigate to HKEY_CURRENT_USER\Control Panel\Keyboard
. Change KeyboardSpeed to your liking.
对于 Windows,打开 regedit.exe 并导航到HKEY_CURRENT_USER\Control Panel\Keyboard
. 根据您的喜好更改 KeyboardSpeed。
回答by Jake
Visual Assist has an option to double your effective key movements in Visual Studio which I use all the time.
Visual Assist 可以选择将我一直使用的 Visual Studio 中的有效按键动作加倍。
回答by Jake
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.
我在我的 PC 上使用 KeyboardKing。它是免费软件,它可以将重复率提高到 200,这已经足够了。我建议将进程优先级设置为高,以获得更平滑的移动和更少的“重复锁定”,这种情况有时会发生并且非常烦人。具有高优先级,它可以完美运行。
No one understands why we navigate by arrows. It's funny.
没有人理解我们为什么用箭头导航。这很有趣。
回答by exinocactus
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.
正如hyperlogic所提到的,在 Mac OS X 上,内部有两个参数处理键盘速度:KeyRepeat
和InitialKeyRepeat
。在系统偏好设置中,它们被映射到Key Repeat Rate
和Delay Until Repeat
滑块。滑块范围和相关的内部参数值(在括号中)如下所示。它们似乎是 15 ms 键盘采样间隔的乘数。
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:
幸运的是,这些参数可以直接在~/Library/Preferences/.GlobalPreferences.plist
文件中设置超出预定义的限制。我发现以下值对自己最方便:
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.
请注意,在最新的 Mac OS X 修订版中,滑块的命名略有不同。
回答by David
For OS X, the kernel extension KeyRemap4MacBook will allow you to fine tune all sorts of keyboard parameters, among which the key repeat rate (I set mine to 15 ms, and it works nice).
对于 OS X,内核扩展 KeyRemap4MacBook 将允许您微调各种键盘参数,其中包括按键重复率(我将我的设置为 15 毫秒,效果很好)。
回答by Robert K
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.
我不知道如何加速超越极限,但我知道如何在一次按下时跳得更远。我的知识只在 Windows 中,因为我没有 Mac 可以在其中执行此操作。 Ctrl + Arrow 跳过一个单词,并且根据编辑器,它可能只是跳到空格的下一部分。您还可以使用 Ctrl + Shift + 箭头在任何方向选择一个单词。
回答by Georgi
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 :).
另一方面,有时似乎每个应用程序都有自己的内置键盘类型率。更不用说 BIOS 属性或操作系统设置了。所以我收集了可以非常快的快捷键(即你打字速度更快Ctrl+右(箭头)-右-右而不是将手指放在右(箭头)键上:)。
Here are some keyboard shortcuts I find most valuable (it works on Windows; I am not sure about OS X):
以下是我认为最有价值的一些键盘快捷键(它适用于 Windows;我不确定 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:
所有这些都可以与 shift 键结合使用,以便在这样做时选择文本。现在让我们来看看更奇怪的东西:
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.
所以这些是我在编程时需要的最常用的快捷方式。