projects
/
VSoRC
/
.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
installed pty
[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
}