May 16, 2013 at 11:26am May 16, 2013 at 11:26am UTC
i've detected each key while using the following two functions:
GetAsyncKeyState()
GetKeyState()
but I am unable to detect the following some keys:
[]\;',./
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#include<iostream>
#include<windows.h>
#include<winuser.h>
#include<cctype>
using namespace std;
int main()
{
char i;
while (1)
{
for (i=8 ; i <= 190 ;i++)
{
if (GetAsyncKeyState(i) == -32767)
{
if (GetKeyState(i) == GetKeyState(0xDB)) /* OxDB is the code for [{(both)*/
{
cout<<"[" ;
}
else
{
cout<<"not pressed" ;
}
}
}
}
return 0;
}
Last edited on May 16, 2013 at 11:26am May 16, 2013 at 11:26am UTC