- Code: Select all
char cmd;
while(true) {
cmd = getche();
switch(cmd) {
case 'w': case 'W':
move(1); break; // Move up
case 's': case 'S':
move(2); break; // Move down
case 'a': case 'A':
move(3); break; // Move left
case 'd': case 'D':
move(4); break; // Move right
case 27: return; // Escape pressed so exit
}
}
The problem with this approach is that there doesn`t seem to be a way to detect key presses like arrow keys, FN, and detect if a key is down or up. I`ve looked into directinput and all I can say is, curse M$! I also looked for info but found nothing, maybe I was looking for the wrong thing?
Comments, suggestions, rants, flames, or spam are appreciated in advance
