#include <conio.h>
#include <stdio.h>
int main()
{
int key=0;
while(key=getch())
{
//printf("%c",key);
switch(key)
{
case 'a':printf("left ");break;
case 's':printf("down ");break;
case 'd':printf("right ");break;
case 'w':printf("up ");break;
}
}
}原文地址:http://blog.csdn.net/qq754406613/article/details/43988485