Warning: file_get_contents() [function.file-get-contents]: SSL: 远程主机强迫关闭了一个现有的连接。 in D:\wwwroot\huidong\wwwroot\function.inc.php on line 884

Warning: file_get_contents(https://whois.pconline.com.cn/jsLabel.jsp?ip=127.0.0.1) [function.file-get-contents]: failed to open stream: HTTP request failed! in D:\wwwroot\huidong\wwwroot\function.inc.php on line 884
键盘无冲检测小程序 - huidong

huidong

首页 | 会员登录 | 关于争取 2022 寒假做出汇东网 Ver3.0.0 !
搜索文章


突发奇想,看看自己的键盘是不是真的“全键无冲”:

#include <stdio.h>
#include <Windows.h>

// 判断键盘按下
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)

void key(char ch)
{
    if (KEY_DOWN(ch))    printf("%c ", ch);
    else                printf("  ");
}

int main()
{
    const char list[] = "ASDFGHJKL";
    while (true)
    {
        for (int i = 0; i < (int)strlen(list); i++)
            key(list[i]);
        printf("\n");
        Sleep(100);
    }
}




返回首页


Copyright (C) 2018-2024 huidong