关于键盘若干个键不能识别的问题
我用getch()函数读取键盘,但是发现CTRL和shift和win键和Caps Lock和 Num Look等不能识别。请问如何识别这些键呢?程序代码:
#include <stdio.h> #include <conio.h> void main(void) { int ch, scan; do { ch = getch(); /* 1st getch() gets ASCII code */ printf("Character is %d\n", ch); if (ch == 0x00 || ch == 0XE0) { /* if extended key */ scan = getch(); /* 2nd getch() gets "scan code" */ printf("\tExtended character: scan is %d\n", scan); } } while (ch != 27); /* exit loop on ESC */ }