Small Windows CLI tool to control key repeat delay and repeat rate (repeat interval) in milliseconds, inspired by Linux:
xset r rate <delay_ms> <repeat_ms>
KR uses Windows FilterKeys (SystemParametersInfo(SPI_SETFILTERKEYS)) to apply values and can optionally persist changes, backup current settings, and restore them later.
A GitHub Release will provide a prebuilt
kr.exe, so most users won't need to compile.
kr 220 15kr 220 15 --persistkr 220 15 --backup --persistkr disable --persistkr --restore --persistkr --help
kr --versionKR enforces “human-friendly” safety limits:
delay_ms: 0..5000rate_ms: 5..2000
If you want different limits, edit these macros in kr.c:
DELAY_MIN_MS,DELAY_MAX_MSRATE_MIN_MS,RATE_MAX_MS
- delay_ms: time in milliseconds before a held key starts repeating.
- rate_ms: time in milliseconds between repeats once repetition begins.
- Smaller
rate_ms⇒ faster repetition.
- Smaller
This matches Linux xset r rate delay repeat semantics (where the second number is the repeat interval in ms).
KR changes keyboard repeat behavior through Windows FilterKeys:
- Setting values enables FilterKeys (
FKF_FILTERKEYSON) and writes:FILTERKEYS.iDelayMSecFILTERKEYS.iRepeatMSec
kr disableturns FilterKeys OFF (clearsFKF_FILTERKEYSON) so the default Windows keyboard repeat settings UI/slider regain control (with Windows' official limits).
Limitations: Actual repeat behavior may still be constrained by keyboard hardware, drivers, remote desktop, accessibility policies, or OS internals.
- Download
kr.exefrom the GitHub Releases page. - Create a folder for user tools, e.g.:
C:\Users\<you>\bin\- or
C:\Tools\KR\
- Move
kr.exeinto that folder. - Add the folder to your User PATH (recommended, no admin required):
- Settings → System → About → Advanced system settings
- Environment Variables…
- Under “User variables”, select
Path→ Edit → New - Add the folder (e.g.
C:\Users\<you>\bin\) - Open a new terminal and run:
kr --help
$dir = "$env:USERPROFILE\bin"
New-Item -ItemType Directory -Force -Path $dir | Out-Null
# Move kr.exe to $dir manually or via script.
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";" + $dir, "User")Close and reopen the terminal afterward.
Just keep kr.exe in a folder and call it with a relative/absolute path:
C:\Tools\KR\kr.exe 220 15 --persistKR can store a backup of your current FilterKeys configuration:
- Backup location (per-user):
%APPDATA%\kr\backup.bin
Workflow:
- Save backup + apply:
kr 220 15 --backup --persist
- Later restore:
kr --restore --persist
KR is a single C file (kr.c). The most reproducible open source way to build on Windows is MSYS2 + MinGW-w64 (UCRT64).
Download and install MSYS2 from:
Open the installed terminal:
- MSYS2 UCRT64 (important)
Then run:
pacman -SyuIf it asks you to close/reopen the terminal, do it, then run again:
pacman -SyuIn MSYS2 UCRT64:
pacman -S --needed mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-makeIn MSYS2, GNU Make is commonly available as mingw32-make.exe.
From the repo root:
mingw32-makeClean:
mingw32-make cleangcc -O2 -Wall -Wextra -pedantic -DWIN32_LEAN_AND_MEAN -s -o kr.exe kr.c -luser32 -lshell32 -lole32 -luuidThe resulting kr.exe will be in the current directory.
Use:
mingw32-make(You can also alias make=mingw32-make if you prefer.)
Ensure you link with:
-lole32 -luuid(in addition to-lshell32)
The provided Makefile already includes these.
- Try running your terminal as Administrator and test again.
- Some environments (corporate policy, accessibility lockdown, remote desktop) may restrict changing system parameters.
Windows repeat behavior can be constrained by:
- keyboard/driver limits
- remote desktop / virtualization
- accessibility settings
- certain input method editors (IME)
Try testing locally (not over RDP) and verifying kr disable returns behavior to the Windows slider.
Licensed under the Mozilla Public License 2.0 (MPL-2.0). See LICENSE.