developer tip

OS의 제한을 초과하여 키 반복률을 높이려면 어떻게해야합니까?

copycodes 2021. 1. 9. 10:14
반응형

OS의 제한을 초과하여 키 반복률을 높이려면 어떻게해야합니까?


소스 코드를 탐색하기 위해 키보드의 커서 키를 사용하는 나쁜 습관이 있습니다. 이것은 제가 15 년 동안해온 일이며, 물론 이것은 제 탐색 속도가 키보드 속도에 의해 제한된다는 것을 의미합니다. Vista와 OS X (MacBook을 이중 부팅)에서 키 반복률을 완전히 높였습니다. 그러나 Visual Studio 및 기타 앱에서는 속도가 여전히 내가 선호하는 것보다 훨씬 느립니다.

Visual Studio 및 기타 텍스트 편집기에서 키 반복 속도를 더 빠르게 만들려면 어떻게해야합니까?


Mac OS X에서 Global Preferences plist를 엽니 다.

open ~/Library/Preferences/.GlobalPreferences.plist

그런 다음 KeyRepeat 필드를 변경합니다. 숫자가 작을수록 커서 속도가 빨라집니다. 설정 대화 상자는 최소 2로만 설정하므로 0 또는 1로 이동하면 커서가 더 빨라집니다.

이 기능을 적용하려면 재부팅해야했습니다.


Windows에서는 시스템 호출 ( SystemParametersInfo(SPI_SETFILTERKEYS,...))로 설정할 수 있습니다 .

나는 나 자신을 위해 유틸리티를 썼다 : keyrate <delay> <repeat>.

Github 저장소 .

링크가 사라지는 경우 전체 소스 :

#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;
}

여러 번 내 창에서 기능을 중앙에 배치하고 싶습니다. 스크롤이 유일한 방법입니다. 또한 Ctrl-left / right는 단어가 아닌 문자가 많은 코드에서 여전히 느릴 수 있습니다. 나는 또한 keyboardking을 사용합니다. 그래도 몇 가지 문제가 있습니다. 첫째, 내가 설정 한 실제 값 대신 기본 속도를 사용하는 경우가 있습니다. 다른 하나는 때때로 초기 지연을 무시한다는 것입니다. 그래도 여전히 매우 유용합니다. 그들은 4 년 전에 6 개월 안에 소스를 공개하겠다고 말했습니다 ... :(

좋아, HCU \ ... \ Keyboard Response를 수정 한 사람의 제안에 따라 이것은 잘 작동합니다.

[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]
"AutoRepeatDelay"="250"
"AutoRepeatRate"="13"
"BounceTime"="0"
"DelayBeforeAcceptance"="0"
"Flags"="59"

Windows 표준 AutoRepeat 지연. 13ms (77 문자 / 초) 반복 속도. 플래그는 FilterKeys를 켭니까? 이 값은 로그인시 읽습니다. 이를 적용하려면 로그 아웃했다가 다시 로그인해야합니다.


Windows의 경우 regedit.exe를 열고 HKEY_CURRENT_USER\Control Panel\Keyboard. 원하는대로 KeyboardSpeed를 변경하십시오.


PC에서 KeyboardKing을 사용하고 있습니다. 그것은 프리웨어이며 반복률을 200까지 높일 수 있습니다. 더 부드러운 움직임과 언젠가 발생하고 매우 성가신 "반복 잠금"을 줄이려면 프로세스 우선 순위를 높음으로 설정하는 것이 좋습니다. 우선 순위가 높으면 완벽하게 작동합니다.

우리가 화살표로 탐색하는 이유를 아무도 이해하지 못합니다. 재밌 네요.


Visual Assist에는 내가 항상 사용하는 Visual Studio에서 효과적인 키 이동을 두 배로 늘릴 수있는 옵션이 있습니다.


키보드 환경 설정 창

에 의해 언급 한 바와 같이 hyperlogic , 맥 OS X에, 내부적으로,이 키보드 속도를 다루는 두 개의 매개 변수는 다음과 같습니다 KeyRepeatInitialKeyRepeat. 시스템 환경 설정에서는 Key Repeat RateDelay Until Repeat슬라이더에 매핑됩니다 . 슬라이더 범위 및 관련 내부 매개 변수 값 (괄호 안)이 아래에 표시됩니다. 15ms 키보드 샘플링 간격의 승수 인 것 같습니다.

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       

다행히도 이러한 매개 변수는 ~/Library/Preferences/.GlobalPreferences.plist파일 에서 직접 사전 정의 된 한계를 초과하여 설정할 수 있습니다 . 나 자신에게 가장 편리한 값은 다음과 같습니다.

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

최신 Mac OS X 개정판에서는 슬라이더의 이름이 약간 다릅니다.


한계 이상으로 가속하는 방법은 모르겠지만 한 번만 누르면 더 빨리 건너 뛸 수 있습니다. 이 작업을 수행 할 Mac이 없기 때문에 내 지식은 Windows에만 있습니다. Ctrl + Arrow는 단어를 건너 뛰고 편집기에 따라 공백의 다음 섹션으로 건너 뛸 수 있습니다. Ctrl + Shift + 화살표를 사용하여 원하는 방향으로 단어를 선택할 수도 있습니다.


저는 키보드로 혼자 작업하는 것을 좋아합니다. 왜? 마우스를 사용할 때 잡아야하기 때문입니다. 시간 손실.

반면에 때때로 모든 응용 프로그램에는 자체 키보드 유형 속도가 내장되어있는 것처럼 보입니다. BIOS 속성이나 OS 설정에서는 말할 필요가 없습니다. 그래서 저는 꽤 빠를 수있는 단축키를 모았습니다 (즉 Ctrl, 오른쪽 (화살표) 키에 손가락을 두는 것 보다 타이핑 + 오른쪽 (화살표)-오른쪽-오른쪽 이 더 빠릅니다 :).

다음은 내가 가장 유용하다고 생각하는 몇 가지 키보드 단축키입니다 (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

이 모든 것이 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)

그래서 이것이 제가 프로그래밍하는 동안 가장 많이 사용되는 단축키입니다.


OS X의 경우 커널 확장 KeyRemap4MacBook을 사용하면 모든 종류의 키보드 매개 변수를 미세 조정할 수 있으며, 그중에서 키 반복 속도 (내가 15ms로 설정했으며 잘 작동합니다).


Mac에서는 옵션 화살표를 사용하여 단어를 건너 뛰고 option + shift + 화살표를 선택하여 선택합니다. Command + 화살표는 줄의 끝이나 시작 또는 문서의 끝이나 시작으로 건너 뜁니다. 페이지 위로, 페이지 아래로, 홈 및 종료 키도 있습니다.) Shift 키를 누르면 해당 키도 선택됩니다.


Windows 7에서는이 작업을 쉽게 수행 할 수없는 것 같습니다.

버튼을 길게 누르면 속도는 Windows 레지스트리 키 (HCU-> Control Panel-> Keyboard-> Keyboard Delay)에 의해 제어됩니다.

이 매개 변수를 0으로 설정하면 최대 반복률을 얻을 수 있습니다. 드라마는 반복 속도가 여전히 느리면 0 이하로 갈 수 없다는 것입니다. 0 지연은 반복 지연이 250ms임을 의미합니다. 그러나 250ms 지연은 여전히 ​​지옥처럼 느립니다. 이것을보십시오 : http://technet.microsoft.com/en-us/library/cc978658.aspx

Accesibility로 이동할 수는 있지만 이러한 옵션은 빠르게 입력하는 괴짜에게 도움을 제공하는 것이 아니라 장애인이 키보드를 사용하도록 돕는 것임을 알아야합니다. 그들은 도움이되지 않습니다. Linux를 사용하십시오.

Windows 용 솔루션은 하드웨어 제어에 있습니다. 키보드의 특수 드라이버를 찾거나 기존 드라이버를 조정하십시오.


질문은 몇 년이 지났지 만 여러 개발자 사이트에서 때때로 동일한 문제가 발생합니다. 그래서 저는 일상적인 개발자 작업에 사용할 대체 솔루션을 제공 할 수 있다고 생각했습니다 (Windows 레지스트리 설정이 저에게 효과가 없었기 때문에).

다음은 AutoHotkey_L을 통해 실행할 수있는 작은 Autorepeat-Script (~ 125 줄)입니다 (단점은 Windows, Vista, 7, 8.1 이상에서만 실행된다는 것입니다).

; ====================================================================
; 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
            }
        }
    }
  1. 위 코드를 텍스트 파일 (UTF-8)에 저장합니다 (예 : "AutorepeatScript.ahk").
  2. AutoHotkey_L 설치
  3. "AutorepeatScript.ahk"를 두 번 클릭하면 훨씬 빠른 화살표 키를 사용할 수 있습니다 (또는 파일을 자동 시작 폴더에 넣습니다).

(스크립트에서 반복 지연 및 속도를 조정할 수 있습니다. '; 사용자 구성 가능'참조).

도움이 되었기를 바랍니다!


글쎄요, 분명 할 수도 있지만 :

  • 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)

또한 각 동작은 명령을 반복 할 횟수를 지정할 수있는 접두어로 숫자를 사용합니다. 예 :

  • 20j -20 줄 아래로 점프
  • 3} -세 단락 아래로
  • 4w -4 단어 앞으로 이동
  • 40G -(절대) 라인 번호 40으로 이동

편집기에서 텍스트를 탐색하는 동일한 방법이 있습니다. 그렇지 않은 경우 더 나은 것으로 전환하는 것을 고려해야합니다.

참조 URL : https://stackoverflow.com/questions/171326/how-can-i-increase-the-key-repeat-rate-beyond-the-oss-limit

반응형