获取按键值

来源:互联网 发布:软件开发工作计划模板 编辑:程序博客网 时间:2024/05/22 17:03

  1. #include <conio.h>      //控制台输出函数头文件,
  2. #include <stdio.h>
  3. int main()
  4. {
  5. int key; 
  6. key = getch();
  7. while( key != 27 ) //键入值不为ESC
  8. {
  9. printf("%d\n", key);
  10. key = getch();
  11. }
  12. }

原创粉丝点击