Windows 在里面请记住注销并重新登录以使其生效。

Windows 在里面请记住注销并重新登录以使其生效。,windows,visual-studio,macos,keyboard,Windows,Visual Studio,Macos,Keyboard,在Windows 7上似乎无法轻松完成此操作 按住按钮时,速度由Windows注册表键控制:HCU->控制面板->键盘->键盘延迟 通过将此参数设置为0,可以获得最大重复率。戏剧性的是,如果重复速度对你来说仍然很慢,你就不能低于0。0-延迟意味着重复延迟为250ms。但是,250毫秒的延迟仍然非常慢。见此: 您仍然可以访问Accessibility,但您应该知道,这些选项是为了帮助残疾人使用键盘,而不是为快速打字的极客提供帮助。他们不会帮忙的。他们告诉你,使用Linux 我认为Windows的解

在Windows 7上似乎无法轻松完成此操作

按住按钮时,速度由Windows注册表键控制:HCU->控制面板->键盘->键盘延迟

通过将此参数设置为0,可以获得最大重复率。戏剧性的是,如果重复速度对你来说仍然很慢,你就不能低于0。0-延迟意味着重复延迟为250ms。但是,250毫秒的延迟仍然非常慢。见此:

您仍然可以访问Accessibility,但您应该知道,这些选项是为了帮助残疾人使用键盘,而不是为快速打字的极客提供帮助。他们不会帮忙的。他们告诉你,使用Linux


我认为Windows的解决方案在于硬件控制。为您的键盘寻找特殊的驱动程序或尝试调整现有的驱动程序。

在Windows中,您可以通过系统调用(
SystemParametersInfo(SPI\u SETFILTERKEYS,…)
)来设置此驱动程序

我为自己编写了一个实用程序:
keyrate

链接消失时的完整来源:

#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;
}
#包括
#包括
#包括
布尔解析字(常量字符*输入,DWORD*输出)
{
字符*结束;
长期结果=strtol(输入和结束,10);
BOOL success=(errno==0&&end!=in);
如果(成功)
{
*out=结果;
}
回归成功;
}
int main(int argc,char*argv[])
{
FILTERKEYS={sizeof(FILTERKEYS)};
如果(argc==1)
{
puts(“未给出参数:禁用”);
}
否则如果(argc!=3)
{
puts(“用法:keyrate\n调用,无需禁用参数”);
返回0;
}
else if(parseDword(argv[1],&keys.iDelayMSec)
&&parseDword(argv[2],&keys.iRepeatMSec))
{
printf(“设置keyrate:delay:%d,rate:%d\n”,(int)keys.iDelayMSec,(int)keys.iRepeatMSec);
keys.dwFlags=FKF_过滤器keyson | FKF_可用;
}
if(!SystemParametersInfo(SPI_SETFILTERKEYS,0,(LPVOID)和keys,0))
{
fprintf(stderr,“系统调用失败。\n无法设置keyrate”);
}
返回0;
}

虽然这个问题已经提了好几年了,但我还是在几个不同的开发人员网站上不时遇到同样的问题。因此,我想我可以提供一个替代解决方案,用于我的日常开发工作(因为Windows注册表设置从来都不适合我)

下面是我的小型自动回复脚本(~125行),它可以通过AutoHotkey_L运行(缺点是,它只能在Windows下运行,至少在Vista、7、8.1下运行):

====================================================================
; DeveloperTools-自动恢复密钥脚本
;
; 该脚本提供了一种机制,可以更快地执行密钥自动重传
; 比Windows操作系统允许的要多。有一些注册表设置
; 在Windows中调整键的重复率,但根据
; 分散用户反馈,注册表解决方案不适用于所有
; 系统。
;
; 请参阅下面的“热键”部分。目前(版本1.0),有
; 是否只映射了箭头键以加快自动回复(包括
;控制和换档修改器)。请随意添加您自己的
; 热键。
;
; 你需要自动热键(http://www.autohotkey.com)运行此脚本。
; 测试兼容性:自动热键,版本v1.1.08.01
; 
; (自动热键版权所有©2004-2013 Chris Mallet和
;其他人——不是我!)
;
; @作者Timo Rumland,2014-01-05
; @版本1.0
; @更新日期2014-01-05
; @麻省理工学院许可证(MIT)
;           (http://opensource.org/licenses/mit-license.php)
; ====================================================================
; ================
; 脚本设置
; ================
#诺恩
#单实例力
发送模式输入
设置工作目录%A\u脚本目录%
; 实例化热键定义下面定义的DeveloperTools
developerTools:=新的developerTools()
; ========
; 快捷键
; ========
; -------------------
; 自动重设热键
; -------------------
~$UP::
~$DOWN::
~$左::
~$RIGHT::
DeveloperTools.startAutorepeatKeyTimer(“”)
返回
~$+向上::
~$+向下::
~$+左::
~$+右::
DeveloperTools.startAutorepeatKeyTimer(“+”)
返回
~$^UP::
~$^DOWN::
~$^左::
~$^RIGHT::
DeveloperTools.startAutorepeatKeyTimer(“^”)
返回
; -------------------------------------------------------
; 上面的热键使用的跳转标签。这是怎么回事
; 自动热键提供“线程”或类似线程的行为。
; -------------------------------------------------------
DeveloperTools\u自动恢复密钥:
设定计时器,关闭
DeveloperTools.startAutorepeatKey()
返回
; ========
; 班级
; ========
类DeveloperTools
{
;可由用户配置
自动恢复延迟:=180
自动恢复速率:=40
;脚本内部使用
repeatKey:=“”
repeatSendString:=“”
KeyModifierBSelength:=2
; -------------------------------------------------------------------------------
;启动当前捕获的热键(A_This热键)的自动重放。给定
;“keyModifierString”用于解析实际键(不带热键修饰符)
;如“~”或“$”)。
; -------------------------------------------------------------------------------
startAutorepeatKeyTimer(keyModifierString)
{
keyModifierLength:=this.keyModifierBaseLength+StrLen(keyModifierString)
this.repeatKey:=SubStr(A_this热键,keyModifierLength+1)
this.repeatSendString:=keyModifierString.{.this.repeatKey.}
SetTimer DeveloperTools\u AutoRepeatKey,%this.autoRepeatDelayMs
}
; ---------------------------------------------------------------------
;启动重复键的循环,从而加快
;比Windows提供的自动恢复速度快。实习生
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)
open ~/Library/Preferences/.GlobalPreferences.plist
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       
KeyRepeat = 1         --> 1/(1*15 ms) = 66.7 char/s
InitialKeyRepeat = 15 --> 15*15 ms = 225 ms
[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]
"AutoRepeatDelay"="250"
"AutoRepeatRate"="13"
"BounceTime"="0"
"DelayBeforeAcceptance"="0"
"Flags"="59"
#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;
}
; ====================================================================
; DeveloperTools - Autorepeat Key Script
;
; This script provides a mechanism to do key-autorepeat way faster
; than the Windows OS would allow. There are some registry settings
; in Windows to tweak the key-repeat-rate, but according to widely 
; spread user feedback, the registry-solution does not work on all 
; systems.
;
; See the "Hotkeys" section below. Currently (Version 1.0), there
; are only the arrow keys mapped for faster autorepeat (including 
; the control and shift modifiers). Feel free to add your own 
; hotkeys.
;
; You need AutoHotkey (http://www.autohotkey.com) to run this script.
; Tested compatibility: AutoHotkey_L, Version v1.1.08.01
; 
; (AutoHotkey Copyright © 2004 - 2013 Chris Mallet and 
; others - not me!)
;
; @author   Timo Rumland <timo.rumland ${at} gmail.com>, 2014-01-05
; @version  1.0
; @updated  2014-01-05
; @license  The MIT License (MIT)
;           (http://opensource.org/licenses/mit-license.php)
; ====================================================================

; ================
; Script Settings
; ================

#NoEnv
#SingleInstance     force
SendMode            Input 
SetWorkingDir       %A_ScriptDir%


; Instantiate the DeveloperTools defined below the hotkey definitions
developerTools      :=  new DeveloperTools()


; ========
; Hotkeys
; ========

    ; -------------------
    ; AutoRepeat Hotkeys
    ; -------------------

    ~$UP::
    ~$DOWN::
    ~$LEFT::
    ~$RIGHT::
        DeveloperTools.startAutorepeatKeyTimer( "" )
    return

    ~$+UP::
    ~$+DOWN::
    ~$+LEFT::
    ~$+RIGHT::
        DeveloperTools.startAutorepeatKeyTimer( "+" )
    return

    ~$^UP::
    ~$^DOWN::
    ~$^LEFT::
    ~$^RIGHT::
        DeveloperTools.startAutorepeatKeyTimer( "^" )
    return

    ; -------------------------------------------------------
    ; Jump label used by the hotkeys above. This is how 
    ; AutoHotkey provides "threads" or thread-like behavior.
    ; -------------------------------------------------------
    DeveloperTools_AutoRepeatKey:
        SetTimer , , Off
        DeveloperTools.startAutorepeatKey()
    return


; ========
; Classes
; ========

    class DeveloperTools
    {
        ; Configurable by user
        autoRepeatDelayMs       :=  180
        autoRepeatRateMs        :=  40

        ; Used internally by the script
        repeatKey               :=  ""
        repeatSendString        :=  ""
        keyModifierBaseLength   :=  2

        ; -------------------------------------------------------------------------------
        ; Starts the autorepeat of the current captured hotkey (A_ThisHotKey). The given
        ; 'keyModifierString' is used for parsing the real key (without hotkey modifiers
        ; like "~" or "$").
        ; -------------------------------------------------------------------------------
        startAutorepeatKeyTimer( keyModifierString )
        {
            keyModifierLength := this.keyModifierBaseLength + StrLen( keyModifierString )

            this.repeatKey := SubStr( A_ThisHotkey, keyModifierLength + 1 )
            this.repeatSendString := keyModifierString . "{" . this.repeatKey . "}"

            SetTimer DeveloperTools_AutoRepeatKey, % this.autoRepeatDelayMs
        }

        ; ---------------------------------------------------------------------
        ; Starts the loop which repeats the key, resulting in a much faster 
        ; autorepeat rate than Windows provides. Internally used by the script
        ; ---------------------------------------------------------------------
        startAutorepeatKey()
        {
            while ( GetKeyState( this.repeatKey, "P" ) )
            {
                Send % this.repeatSendString
                Sleep this.autoRepeatRateMs
            }
        }
    }