Jul 22, 2018 10:46 AM
(This post was last modified: Jul 22, 2018 10:46 AM by F.A.S.T.)
Soo, The code below is supposed to print out whenever the keys defined are pressed.
But the opposite happens.
It does not print out the keys pressed, Instead, Only default.
Also, Flush(); is just a function that prints out on the screen.
But the opposite happens.
It does not print out the keys pressed, Instead, Only default.
Also, Flush(); is just a function that prints out on the screen.
PHP Code
<?php
int main()
{
char ikey = 0;
//string data = to_string(ikey);
while (true) {
switch (GetAsyncKeyState(ikey)) {
case up:
flush("[UP]");
break;
case down:
flush("[DOWN]");
break;
case left:
flush("[LEFT]");
break;
case right:
flush("[RIGHT]");
break;
default:
flush("[UNKNOWN-KEY-PRESSED]");
break;
}
}
return 0;
}


![[Image: 5Iq5rDJ.gif]](https://i.imgur.com/5Iq5rDJ.gif)