GetKeyState
Posted: Fri Oct 10, 2003 8:54 am
Can I please trouble someone for a demo of the usage of GetKeyState?
char *key = GetKeyState(); //Get entire keyboard state
if(key[KEY_RIGHT] == 1) //Test if right key is pressed
{
x = x + 5; //Move actor to right
}
if(key[KEY_LEFT] == 1) //Test if left key is pressed
{
x = x - 5; //Move actor to left
}