We know for:
char *key = GetKeyState();
if(key[KEY_3] == 1)
{
}
But how to do that like:
char *key = GetKeyState();
if(keyUP[KEY_3] == 1)
{
}
char*key = GetKeyState();
if(key[KEY_3]==0 && last_key[KEY_3]==1)
{
// keyup
}
last_key = GetKeyState(); // this way it next event it knows what the previous frame had
char*key = GetKeyState();
if(key[KEY_3]==0 && last_key[KEY_3]==1)
{
ExitGame();
int key3 = 0;
char* key = GetKeyState();
if(key[KEY_3]==0 && key3==1)
{
ExitGame();
}
key3 = key[KEY_3];
int key=getLastKey();
switch(key)
{
case KEY_3:
//do what you want here;
break;
}
char* key = GetKeyState();
if(key[KEY_3]==1&&pressed==0)
{
pressed=1;
ExitGame();
}
if(key[KEY_3]==0)
{
pressed=0;
}
#define key3 = 0;//or key3 = 0 (key3 = variable)
char* key = GetKeyState();
if(key[KEY_3]==0 && key3==1)
{
ExitGame();
}
key3 = key[KEY_3];
//key down event
#define key3
"actor" = GetKeyState();
if(key[KEY_3]==1) {
key3=0;
}
if(key[KEY_3]==0) {
key3=1;
}
if(key3==1) {
ExitGame()
}
int key3;
// "actor" = GetKeyState();
// that doesn't make sense
char* key = GetKeyState(); // this does make sense
skydereign wrote:Well, that actually won't work properly. For that method of keyup, you have to assume that only one key is pressed at a time. The getLastKey is not a getLastKeyChange function, but rather a getLastKeyPressed function. That means if you hold down space, and then press left, when you let go of space your code will trigger a keyup left. However using it for keydown events is rather handy, and it guarantees the correct key press.
Users browsing this forum: No registered users and 1 guest