69,369
社区成员
发帖
与我相关
我的任务
分享
BYTE CurrentKeyoardState[256]={0};
while(1)
{
Sleep(1000);
GetKeyboardState(CurrentKeyoardState);
if (CurrentKeyoardState[VK_CAPITAL]&0x8001)
{
printf("caps lock on!");
// Sleep(1000);
}
else
//GetKeyboardState(CurrentKeyoardState);
{
printf("caps lock off!");
//Sleep(1000);
}
ZeroMemory(CurrentKeyoardState,256);
}