|
发表于 2004-6-4 22:33:25
|
显示全部楼层
这个问题我记得以前讨论过,alt+x等于连续输入了两个字符,第一个是27(Esc键),第二个是x键,和先按Esc再按x是一样的。
写个小程序验证一下:
- #include <curses.h>
- int
- main(void)
- {
- int c;
- initscr();
- keypad(stdscr, TRUE);
- cbreak();
- noecho();
- while((c = getch()) != 'q'){
- printw("input is %d: %c. ", c, c);
- refresh();
- }
- endwin();
- exit(0);
- }
复制代码 |
|