bool IsKeyPressed(int iKey) { //here is the IsKeyPressed Function
return ((GetAsyncKeyState(iKey) & 1) == 1);
}
if(IsKeyPressed(VK_RETURN)==true && bFirstTime==true) { //select
aux=99;
iaArray[iSelectedX][iSelectedY]=aux; /* WORKS! kinda*/
bFirstTime=false;
}
if(IsKeyPressed(VK_RETURN)==true && bFirstTime==false) { //confirm
iaArray[iSelectedX][iSelectedY]=11; /* Doesn't WORK! doesn't get executed*/
bFirstTime=true;
}
/*
The first if gets executed... the second if will never get executed... so there must be a problem
within the second if statement at (IsKeyPressed(VK_RETURN)==true) ...
it probably doesn't return true.. for some reason... Why?
*/
Here is the full code:
What the code should do ... There's an 3 by 3 array like the X/O game ... and you can move through the game table by using key UP, DOWN, LEFT, RIGHT.. and when you press ENTER it should copy the number in the selected place and move it in another place when you press ENTER again...