我正在用C实现一个小益智游戏,其中我需要获取4个箭头的扫描码
键。实际上,在 C 编程中我实现了
需要获取方向键扫码的益智游戏
我必须使用用户定义的 getkey() 函数
功能。但我不知道这个getkey()
函数的格式是什么。
请告诉我一种简单的获取方向键扫码的方法并详细说明。我正在使用 Turbo C,我知道它很旧,但我仍然想要它。
最佳答案
试试这个:
#include <conio.h>
#include <stdio.h>
int main()
{
int c = 0;
while (c != EOF)
{
c = _getch();
printf("%d\n",c);
}
return 0;
}
关于c - 如何获取方向键扫描码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25519861/