Created
March 3, 2024 22:10
-
-
Save Affonso-Gui/4ae0edfbaeb60111192a7c7a48c1ac6d to your computer and use it in GitHub Desktop.
WinAPI - Change repeat key rate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
// ref. https://github.com/EricTetz/keyrate | |
// Compile from Developer PowerShell for VS with: | |
// cl /Fe$@ /DWIN32_LEAN_AND_MEAN /O1 /Oa /Og /Os /Oy /Oi user32.lib $? | |
int main(int argc, char* argv[]) | |
{ | |
FILTERKEYS keys = { sizeof(FILTERKEYS) }; | |
keys.iDelayMSec = 230; | |
keys.iRepeatMSec = 30; | |
keys.dwFlags = FKF_FILTERKEYSON|FKF_AVAILABLE; | |
if (!SystemParametersInfo (SPI_SETFILTERKEYS, 0, (LPVOID) &keys, 0)) | |
{ | |
fprintf (stderr, "System call failed.\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment