projects
/
VSoRC
/
.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
cd6ed1943adbd22f87a7d0faf34aba0faa0916f6
[VSoRC/.git]
/
node_modules
/
node-pty
/
deps
/
winpty
/
misc
/
GetCh.cc
1
#include <conio.h>
2
#include <ctype.h>
3
#include <stdio.h>
4
5
int main() {
6
printf("\nPress any keys -- Ctrl-D exits\n\n");
7
8
while (true) {
9
const int ch = getch();
10
printf("0x%x", ch);
11
if (isgraph(ch)) {
12
printf(" '%c'", ch);
13
}
14
printf("\n");
15
if (ch == 0x4) { // Ctrl-D
16
break;
17
}
18
}
19
return 0;
20
}