#include <iostream>
#include <windows.h>
using namespace std;

void updateStatus(FILTERKEYS&, int);

int main() {

    cout << "==========================" << endl;
    cout << "/                        /" << endl;
    cout << "/    FilterKey Updater   /" << endl;
    cout << "/                        /" << endl;
    cout << "==========================" << endl;

    FILTERKEYS fk{};
    fk.cbSize = sizeof(fk);

    //필터키 켜기
    cout << "Turned on Filter Key" << endl;
    SystemParametersInfo(
        SPI_GETFILTERKEYS,
        sizeof(fk),
        &fk,
        0);
    fk.dwFlags |= FKF_FILTERKEYSON;
    SystemParametersInfo(
        SPI_SETFILTERKEYS,
        sizeof(fk),
        &fk,
        SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
    //필터키 켜기

    int value;
    cout << "Enter AutoRepeatRate Value: ";
    while (cin >> value) {
        updateStatus(fk, value);
        cout << "Enter AutoRepeatRate Value: ";
    }

    // 필터키 끄기
    SystemParametersInfo(
        SPI_GETFILTERKEYS,
        sizeof(fk),
        &fk,
        0);
    fk.dwFlags &= ~FKF_FILTERKEYSON;
    SystemParametersInfo(
        SPI_SETFILTERKEYS,
        sizeof(fk),
        &fk,
        SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
    cout << "Turned off Filter Key" << endl;
    // 필터키 끄기

    return 0;

}

void updateStatus(FILTERKEYS& fk, int value) {
    SystemParametersInfo(
        SPI_GETFILTERKEYS,
        sizeof(fk),
        &fk,
        0);

    fk.iRepeatMSec = value;

    SystemParametersInfo(
        SPI_SETFILTERKEYS,
        sizeof(fk),
        &fk,
        SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);

    cout << "Changed Delay Value: " << value << endl;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: