getch_c/example.c

27 lines
422 B
C
Raw Permalink Normal View History

2021-02-22 15:17:06 -08:00
#include <stdio.h>
#include "getch.h"
int main() {
int key = _getch();
2021-02-24 20:46:16 -08:00
printf("Key %d\n", key);
2021-02-22 15:17:06 -08:00
if (key == 0 || key == 224) {
key = _getch();
printf("Special Key : %d\n", key);
}
do {
key = _getch();
printf("Key : %d\n", key);
} while(key != 113);
_ungetch('A');
int res = cinPeek();
int getch = _getch();
printf("%c : %c\n\r", res, getch);
2021-02-22 15:17:06 -08:00
}